The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_KL05Z/TOOLCHAIN_GCC_ARM/MKL05Z4.ld@172:65be27845400, 2019-02-20 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Feb 20 20:53:29 2019 +0000
- Revision:
- 172:65be27845400
- Parent:
- 171:3a7713b1edbc
mbed library release version 165
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AnnaBridge | 156:ff21514d8981 | 1 | /* |
AnnaBridge | 156:ff21514d8981 | 2 | * KL05Z ARM GCC linker script file, Martin Kojtal (0xc0170) |
AnnaBridge | 156:ff21514d8981 | 3 | */ |
AnnaBridge | 156:ff21514d8981 | 4 | |
AnnaBridge | 156:ff21514d8981 | 5 | MEMORY |
AnnaBridge | 156:ff21514d8981 | 6 | { |
AnnaBridge | 156:ff21514d8981 | 7 | VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000410 |
AnnaBridge | 156:ff21514d8981 | 8 | FLASH (rx) : ORIGIN = 0x00000410, LENGTH = 32K - 0x00000410 |
AnnaBridge | 156:ff21514d8981 | 9 | RAM (rwx) : ORIGIN = 0x1FFFFCC0, LENGTH = 4K - 0xC0 |
AnnaBridge | 156:ff21514d8981 | 10 | } |
AnnaBridge | 156:ff21514d8981 | 11 | |
AnnaBridge | 156:ff21514d8981 | 12 | /* Linker script to place sections and symbol values. Should be used together |
AnnaBridge | 156:ff21514d8981 | 13 | * with other linker script that defines memory regions FLASH and RAM. |
AnnaBridge | 156:ff21514d8981 | 14 | * It references following symbols, which must be defined in code: |
AnnaBridge | 156:ff21514d8981 | 15 | * _reset_init : Entry of reset handler |
AnnaBridge | 156:ff21514d8981 | 16 | * |
AnnaBridge | 156:ff21514d8981 | 17 | * It defines following symbols, which code can use without definition: |
AnnaBridge | 156:ff21514d8981 | 18 | * __exidx_start |
AnnaBridge | 156:ff21514d8981 | 19 | * __exidx_end |
AnnaBridge | 156:ff21514d8981 | 20 | * __etext |
AnnaBridge | 156:ff21514d8981 | 21 | * __data_start__ |
AnnaBridge | 156:ff21514d8981 | 22 | * __preinit_array_start |
AnnaBridge | 156:ff21514d8981 | 23 | * __preinit_array_end |
AnnaBridge | 156:ff21514d8981 | 24 | * __init_array_start |
AnnaBridge | 156:ff21514d8981 | 25 | * __init_array_end |
AnnaBridge | 156:ff21514d8981 | 26 | * __fini_array_start |
AnnaBridge | 156:ff21514d8981 | 27 | * __fini_array_end |
AnnaBridge | 156:ff21514d8981 | 28 | * __data_end__ |
AnnaBridge | 156:ff21514d8981 | 29 | * __bss_start__ |
AnnaBridge | 156:ff21514d8981 | 30 | * __bss_end__ |
AnnaBridge | 156:ff21514d8981 | 31 | * __end__ |
AnnaBridge | 156:ff21514d8981 | 32 | * end |
AnnaBridge | 156:ff21514d8981 | 33 | * __HeapLimit |
AnnaBridge | 156:ff21514d8981 | 34 | * __StackLimit |
AnnaBridge | 156:ff21514d8981 | 35 | * __StackTop |
AnnaBridge | 156:ff21514d8981 | 36 | * __stack |
AnnaBridge | 156:ff21514d8981 | 37 | */ |
AnnaBridge | 156:ff21514d8981 | 38 | ENTRY(Reset_Handler) |
AnnaBridge | 156:ff21514d8981 | 39 | |
AnnaBridge | 156:ff21514d8981 | 40 | SECTIONS |
AnnaBridge | 156:ff21514d8981 | 41 | { |
AnnaBridge | 156:ff21514d8981 | 42 | .isr_vector : |
AnnaBridge | 156:ff21514d8981 | 43 | { |
AnnaBridge | 156:ff21514d8981 | 44 | __vector_table = .; |
AnnaBridge | 156:ff21514d8981 | 45 | KEEP(*(.vector_table)) |
AnnaBridge | 171:3a7713b1edbc | 46 | . = ALIGN(8); |
AnnaBridge | 156:ff21514d8981 | 47 | } > VECTORS |
AnnaBridge | 156:ff21514d8981 | 48 | |
AnnaBridge | 156:ff21514d8981 | 49 | .text : |
AnnaBridge | 156:ff21514d8981 | 50 | { |
AnnaBridge | 156:ff21514d8981 | 51 | *(.text*) |
AnnaBridge | 156:ff21514d8981 | 52 | |
AnnaBridge | 156:ff21514d8981 | 53 | KEEP(*(.init)) |
AnnaBridge | 156:ff21514d8981 | 54 | KEEP(*(.fini)) |
AnnaBridge | 156:ff21514d8981 | 55 | |
AnnaBridge | 156:ff21514d8981 | 56 | /* .ctors */ |
AnnaBridge | 156:ff21514d8981 | 57 | *crtbegin.o(.ctors) |
AnnaBridge | 156:ff21514d8981 | 58 | *crtbegin?.o(.ctors) |
AnnaBridge | 156:ff21514d8981 | 59 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) |
AnnaBridge | 156:ff21514d8981 | 60 | *(SORT(.ctors.*)) |
AnnaBridge | 156:ff21514d8981 | 61 | *(.ctors) |
AnnaBridge | 156:ff21514d8981 | 62 | |
AnnaBridge | 156:ff21514d8981 | 63 | /* .dtors */ |
AnnaBridge | 156:ff21514d8981 | 64 | *crtbegin.o(.dtors) |
AnnaBridge | 156:ff21514d8981 | 65 | *crtbegin?.o(.dtors) |
AnnaBridge | 156:ff21514d8981 | 66 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) |
AnnaBridge | 156:ff21514d8981 | 67 | *(SORT(.dtors.*)) |
AnnaBridge | 156:ff21514d8981 | 68 | *(.dtors) |
AnnaBridge | 156:ff21514d8981 | 69 | |
AnnaBridge | 156:ff21514d8981 | 70 | *(.rodata*) |
AnnaBridge | 156:ff21514d8981 | 71 | |
AnnaBridge | 156:ff21514d8981 | 72 | KEEP(*(.eh_frame*)) |
AnnaBridge | 156:ff21514d8981 | 73 | } > FLASH |
AnnaBridge | 156:ff21514d8981 | 74 | |
AnnaBridge | 156:ff21514d8981 | 75 | .ARM.extab : |
AnnaBridge | 156:ff21514d8981 | 76 | { |
AnnaBridge | 156:ff21514d8981 | 77 | *(.ARM.extab* .gnu.linkonce.armextab.*) |
AnnaBridge | 156:ff21514d8981 | 78 | } > FLASH |
AnnaBridge | 156:ff21514d8981 | 79 | |
AnnaBridge | 156:ff21514d8981 | 80 | __exidx_start = .; |
AnnaBridge | 156:ff21514d8981 | 81 | .ARM.exidx : |
AnnaBridge | 156:ff21514d8981 | 82 | { |
AnnaBridge | 156:ff21514d8981 | 83 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
AnnaBridge | 156:ff21514d8981 | 84 | } > FLASH |
AnnaBridge | 156:ff21514d8981 | 85 | __exidx_end = .; |
AnnaBridge | 156:ff21514d8981 | 86 | |
AnnaBridge | 156:ff21514d8981 | 87 | __etext = .; |
AnnaBridge | 156:ff21514d8981 | 88 | |
AnnaBridge | 156:ff21514d8981 | 89 | .data : AT (__etext) |
AnnaBridge | 156:ff21514d8981 | 90 | { |
AnnaBridge | 156:ff21514d8981 | 91 | __data_start__ = .; |
AnnaBridge | 156:ff21514d8981 | 92 | *(vtable) |
AnnaBridge | 156:ff21514d8981 | 93 | *(.data*) |
AnnaBridge | 156:ff21514d8981 | 94 | |
AnnaBridge | 171:3a7713b1edbc | 95 | . = ALIGN(8); |
AnnaBridge | 156:ff21514d8981 | 96 | /* preinit data */ |
AnnaBridge | 156:ff21514d8981 | 97 | PROVIDE_HIDDEN (__preinit_array_start = .); |
AnnaBridge | 156:ff21514d8981 | 98 | KEEP(*(.preinit_array)) |
AnnaBridge | 156:ff21514d8981 | 99 | PROVIDE_HIDDEN (__preinit_array_end = .); |
AnnaBridge | 156:ff21514d8981 | 100 | |
AnnaBridge | 171:3a7713b1edbc | 101 | . = ALIGN(8); |
AnnaBridge | 156:ff21514d8981 | 102 | /* init data */ |
AnnaBridge | 156:ff21514d8981 | 103 | PROVIDE_HIDDEN (__init_array_start = .); |
AnnaBridge | 156:ff21514d8981 | 104 | KEEP(*(SORT(.init_array.*))) |
AnnaBridge | 156:ff21514d8981 | 105 | KEEP(*(.init_array)) |
AnnaBridge | 156:ff21514d8981 | 106 | PROVIDE_HIDDEN (__init_array_end = .); |
AnnaBridge | 156:ff21514d8981 | 107 | |
AnnaBridge | 156:ff21514d8981 | 108 | |
AnnaBridge | 171:3a7713b1edbc | 109 | . = ALIGN(8); |
AnnaBridge | 156:ff21514d8981 | 110 | /* finit data */ |
AnnaBridge | 156:ff21514d8981 | 111 | PROVIDE_HIDDEN (__fini_array_start = .); |
AnnaBridge | 156:ff21514d8981 | 112 | KEEP(*(SORT(.fini_array.*))) |
AnnaBridge | 156:ff21514d8981 | 113 | KEEP(*(.fini_array)) |
AnnaBridge | 156:ff21514d8981 | 114 | PROVIDE_HIDDEN (__fini_array_end = .); |
AnnaBridge | 156:ff21514d8981 | 115 | |
AnnaBridge | 171:3a7713b1edbc | 116 | . = ALIGN(8); |
AnnaBridge | 156:ff21514d8981 | 117 | /* All data end */ |
AnnaBridge | 156:ff21514d8981 | 118 | __data_end__ = .; |
AnnaBridge | 156:ff21514d8981 | 119 | |
AnnaBridge | 156:ff21514d8981 | 120 | } > RAM |
AnnaBridge | 156:ff21514d8981 | 121 | |
AnnaBridge | 156:ff21514d8981 | 122 | .bss : |
AnnaBridge | 156:ff21514d8981 | 123 | { |
AnnaBridge | 156:ff21514d8981 | 124 | __bss_start__ = .; |
AnnaBridge | 156:ff21514d8981 | 125 | *(.bss*) |
AnnaBridge | 156:ff21514d8981 | 126 | *(COMMON) |
AnnaBridge | 156:ff21514d8981 | 127 | __bss_end__ = .; |
AnnaBridge | 156:ff21514d8981 | 128 | } > RAM |
AnnaBridge | 156:ff21514d8981 | 129 | |
AnnaBridge | 156:ff21514d8981 | 130 | .heap : |
AnnaBridge | 156:ff21514d8981 | 131 | { |
AnnaBridge | 156:ff21514d8981 | 132 | __end__ = .; |
AnnaBridge | 156:ff21514d8981 | 133 | end = __end__; |
AnnaBridge | 156:ff21514d8981 | 134 | *(.heap*) |
AnnaBridge | 156:ff21514d8981 | 135 | __HeapLimit = .; |
AnnaBridge | 156:ff21514d8981 | 136 | } > RAM |
AnnaBridge | 156:ff21514d8981 | 137 | |
AnnaBridge | 156:ff21514d8981 | 138 | /* .stack_dummy section doesn't contains any symbols. It is only |
AnnaBridge | 156:ff21514d8981 | 139 | * used for linker to calculate size of stack sections, and assign |
AnnaBridge | 156:ff21514d8981 | 140 | * values to stack symbols later */ |
AnnaBridge | 156:ff21514d8981 | 141 | .stack_dummy : |
AnnaBridge | 156:ff21514d8981 | 142 | { |
AnnaBridge | 156:ff21514d8981 | 143 | *(.stack) |
AnnaBridge | 156:ff21514d8981 | 144 | } > RAM |
AnnaBridge | 156:ff21514d8981 | 145 | |
AnnaBridge | 156:ff21514d8981 | 146 | /* Set stack top to end of RAM, and stack limit move down by |
AnnaBridge | 156:ff21514d8981 | 147 | * size of stack_dummy section */ |
AnnaBridge | 156:ff21514d8981 | 148 | __StackTop = ORIGIN(RAM) + LENGTH(RAM); |
AnnaBridge | 156:ff21514d8981 | 149 | __StackLimit = __StackTop - SIZEOF(.stack_dummy); |
AnnaBridge | 156:ff21514d8981 | 150 | PROVIDE(__stack = __StackTop); |
AnnaBridge | 156:ff21514d8981 | 151 | |
AnnaBridge | 156:ff21514d8981 | 152 | /* Check if data + heap + stack exceeds RAM limit */ |
AnnaBridge | 156:ff21514d8981 | 153 | ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") |
AnnaBridge | 156:ff21514d8981 | 154 | } |