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_NUMAKER_PFM_M453/TOOLCHAIN_GCC_ARM/M453.ld@143:86740a56073b, 2017-05-26 (annotated)
- Committer:
- AnnaBridge
- Date:
- Fri May 26 12:30:20 2017 +0100
- Revision:
- 143:86740a56073b
- Parent:
- 141:794e51388b66
Release 143 of the mbed library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 128:9bcdf88f62b0 | 1 | /* |
<> | 128:9bcdf88f62b0 | 2 | * Nuvoton M453 GCC linker script file |
<> | 128:9bcdf88f62b0 | 3 | */ |
<> | 128:9bcdf88f62b0 | 4 | |
Anna Bridge |
141:794e51388b66 | 5 | #if !defined(MBED_APP_START) |
Anna Bridge |
141:794e51388b66 | 6 | #define MBED_APP_START 0x00000000 |
Anna Bridge |
141:794e51388b66 | 7 | #endif |
Anna Bridge |
141:794e51388b66 | 8 | |
Anna Bridge |
141:794e51388b66 | 9 | #if !defined(MBED_APP_SIZE) |
Anna Bridge |
141:794e51388b66 | 10 | #define MBED_APP_SIZE 0x00040000 |
Anna Bridge |
141:794e51388b66 | 11 | #endif |
Anna Bridge |
141:794e51388b66 | 12 | |
<> | 130:d75b3fe1f5cb | 13 | StackSize = 0x800; |
<> | 128:9bcdf88f62b0 | 14 | |
<> | 128:9bcdf88f62b0 | 15 | MEMORY |
<> | 128:9bcdf88f62b0 | 16 | { |
Anna Bridge |
141:794e51388b66 | 17 | VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x00000400 |
Anna Bridge |
141:794e51388b66 | 18 | FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x00000400 |
<> | 128:9bcdf88f62b0 | 19 | RAM_INTERN (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 - 0x00000000 |
<> | 128:9bcdf88f62b0 | 20 | } |
<> | 128:9bcdf88f62b0 | 21 | |
<> | 128:9bcdf88f62b0 | 22 | /** |
<> | 128:9bcdf88f62b0 | 23 | * Must match cmsis_nvic.h |
<> | 128:9bcdf88f62b0 | 24 | */ |
<> | 128:9bcdf88f62b0 | 25 | __vector_size = 4 * (16 + 64); |
<> | 128:9bcdf88f62b0 | 26 | |
<> | 128:9bcdf88f62b0 | 27 | |
<> | 128:9bcdf88f62b0 | 28 | /* Linker script to place sections and symbol values. Should be used together |
<> | 128:9bcdf88f62b0 | 29 | * with other linker script that defines memory regions FLASH and RAM. |
<> | 128:9bcdf88f62b0 | 30 | * It references following symbols, which must be defined in code: |
<> | 128:9bcdf88f62b0 | 31 | * Reset_Handler : Entry of reset handler |
<> | 128:9bcdf88f62b0 | 32 | * |
<> | 128:9bcdf88f62b0 | 33 | * It defines following symbols, which code can use without definition: |
<> | 128:9bcdf88f62b0 | 34 | * __exidx_start |
<> | 128:9bcdf88f62b0 | 35 | * __exidx_end |
<> | 128:9bcdf88f62b0 | 36 | * __etext |
<> | 128:9bcdf88f62b0 | 37 | * __data_start__ |
<> | 128:9bcdf88f62b0 | 38 | * __preinit_array_start |
<> | 128:9bcdf88f62b0 | 39 | * __preinit_array_end |
<> | 128:9bcdf88f62b0 | 40 | * __init_array_start |
<> | 128:9bcdf88f62b0 | 41 | * __init_array_end |
<> | 128:9bcdf88f62b0 | 42 | * __fini_array_start |
<> | 128:9bcdf88f62b0 | 43 | * __fini_array_end |
<> | 128:9bcdf88f62b0 | 44 | * __data_end__ |
<> | 128:9bcdf88f62b0 | 45 | * __bss_start__ |
<> | 128:9bcdf88f62b0 | 46 | * __bss_end__ |
<> | 128:9bcdf88f62b0 | 47 | * __end__ |
<> | 128:9bcdf88f62b0 | 48 | * end |
<> | 128:9bcdf88f62b0 | 49 | * __HeapLimit |
<> | 128:9bcdf88f62b0 | 50 | * __StackLimit |
<> | 128:9bcdf88f62b0 | 51 | * __StackTop |
<> | 128:9bcdf88f62b0 | 52 | * __stack |
<> | 128:9bcdf88f62b0 | 53 | */ |
<> | 128:9bcdf88f62b0 | 54 | ENTRY(Reset_Handler) |
<> | 128:9bcdf88f62b0 | 55 | |
<> | 128:9bcdf88f62b0 | 56 | SECTIONS |
<> | 128:9bcdf88f62b0 | 57 | { |
<> | 128:9bcdf88f62b0 | 58 | .isr_vector : |
<> | 128:9bcdf88f62b0 | 59 | { |
<> | 128:9bcdf88f62b0 | 60 | __vector_table = .; |
<> | 128:9bcdf88f62b0 | 61 | KEEP(*(.vector_table)) |
<> | 128:9bcdf88f62b0 | 62 | . = ALIGN(4); |
<> | 128:9bcdf88f62b0 | 63 | } > VECTORS |
<> | 128:9bcdf88f62b0 | 64 | |
<> | 128:9bcdf88f62b0 | 65 | /* ensure that uvisor bss is at the beginning of memory */ |
<> | 128:9bcdf88f62b0 | 66 | .uvisor.bss (NOLOAD): |
<> | 128:9bcdf88f62b0 | 67 | { |
<> | 128:9bcdf88f62b0 | 68 | . = ALIGN(32); |
<> | 128:9bcdf88f62b0 | 69 | __uvisor_bss_start = .; |
<> | 128:9bcdf88f62b0 | 70 | |
<> | 128:9bcdf88f62b0 | 71 | /* protected uvisor main bss */ |
<> | 128:9bcdf88f62b0 | 72 | . = ALIGN(32); |
<> | 128:9bcdf88f62b0 | 73 | __uvisor_bss_main_start = .; |
<> | 128:9bcdf88f62b0 | 74 | KEEP(*(.keep.uvisor.bss.main)) |
<> | 128:9bcdf88f62b0 | 75 | . = ALIGN(32); |
<> | 128:9bcdf88f62b0 | 76 | __uvisor_bss_main_end = .; |
<> | 128:9bcdf88f62b0 | 77 | |
<> | 128:9bcdf88f62b0 | 78 | /* protected uvisor secure boxes bss */ |
<> | 128:9bcdf88f62b0 | 79 | . = ALIGN(32); |
<> | 128:9bcdf88f62b0 | 80 | __uvisor_bss_boxes_start = .; |
<> | 128:9bcdf88f62b0 | 81 | KEEP(*(.keep.uvisor.bss.boxes)) |
<> | 128:9bcdf88f62b0 | 82 | . = ALIGN(32); |
<> | 128:9bcdf88f62b0 | 83 | __uvisor_bss_boxes_end = .; |
<> | 128:9bcdf88f62b0 | 84 | |
<> | 128:9bcdf88f62b0 | 85 | /* Ensure log2(size) alignment of the uvisor region, to ensure that the region can be effectively protected by the MPU. */ |
<> | 128:9bcdf88f62b0 | 86 | . = ALIGN(1 << LOG2CEIL(__uvisor_bss_boxes_end - __uvisor_bss_start)); |
<> | 128:9bcdf88f62b0 | 87 | __uvisor_bss_end = .; |
<> | 128:9bcdf88f62b0 | 88 | } > RAM_INTERN |
<> | 128:9bcdf88f62b0 | 89 | |
<> | 128:9bcdf88f62b0 | 90 | .text : |
<> | 128:9bcdf88f62b0 | 91 | { |
<> | 128:9bcdf88f62b0 | 92 | /* uVisor code and data */ |
<> | 128:9bcdf88f62b0 | 93 | . = ALIGN(4); |
<> | 128:9bcdf88f62b0 | 94 | __uvisor_main_start = .; |
<> | 128:9bcdf88f62b0 | 95 | *(.uvisor.main) |
<> | 128:9bcdf88f62b0 | 96 | __uvisor_main_end = .; |
<> | 128:9bcdf88f62b0 | 97 | |
<> | 128:9bcdf88f62b0 | 98 | *(.text*) |
<> | 128:9bcdf88f62b0 | 99 | |
<> | 128:9bcdf88f62b0 | 100 | KEEP(*(.init)) |
<> | 128:9bcdf88f62b0 | 101 | KEEP(*(.fini)) |
<> | 128:9bcdf88f62b0 | 102 | |
<> | 128:9bcdf88f62b0 | 103 | /* .ctors */ |
<> | 128:9bcdf88f62b0 | 104 | *crtbegin.o(.ctors) |
<> | 128:9bcdf88f62b0 | 105 | *crtbegin?.o(.ctors) |
<> | 128:9bcdf88f62b0 | 106 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) |
<> | 128:9bcdf88f62b0 | 107 | *(SORT(.ctors.*)) |
<> | 128:9bcdf88f62b0 | 108 | *(.ctors) |
<> | 128:9bcdf88f62b0 | 109 | |
<> | 128:9bcdf88f62b0 | 110 | /* .dtors */ |
<> | 128:9bcdf88f62b0 | 111 | *crtbegin.o(.dtors) |
<> | 128:9bcdf88f62b0 | 112 | *crtbegin?.o(.dtors) |
<> | 128:9bcdf88f62b0 | 113 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) |
<> | 128:9bcdf88f62b0 | 114 | *(SORT(.dtors.*)) |
<> | 128:9bcdf88f62b0 | 115 | *(.dtors) |
<> | 128:9bcdf88f62b0 | 116 | |
<> | 128:9bcdf88f62b0 | 117 | *(.rodata*) |
<> | 128:9bcdf88f62b0 | 118 | |
<> | 128:9bcdf88f62b0 | 119 | KEEP(*(.eh_frame*)) |
<> | 128:9bcdf88f62b0 | 120 | } > FLASH |
<> | 128:9bcdf88f62b0 | 121 | |
<> | 128:9bcdf88f62b0 | 122 | .ARM.extab : |
<> | 128:9bcdf88f62b0 | 123 | { |
<> | 128:9bcdf88f62b0 | 124 | *(.ARM.extab* .gnu.linkonce.armextab.*) |
<> | 128:9bcdf88f62b0 | 125 | } > FLASH |
<> | 128:9bcdf88f62b0 | 126 | |
<> | 128:9bcdf88f62b0 | 127 | .ARM.exidx : |
<> | 128:9bcdf88f62b0 | 128 | { |
<> | 128:9bcdf88f62b0 | 129 | __exidx_start = .; |
<> | 128:9bcdf88f62b0 | 130 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
<> | 128:9bcdf88f62b0 | 131 | __exidx_end = .; |
<> | 128:9bcdf88f62b0 | 132 | } > FLASH |
<> | 128:9bcdf88f62b0 | 133 | |
<> | 128:9bcdf88f62b0 | 134 | /* .stack section doesn't contains any symbols. It is only |
<> | 128:9bcdf88f62b0 | 135 | * used for linker to reserve space for the main stack section |
<> | 128:9bcdf88f62b0 | 136 | * WARNING: .stack should come immediately after the last secure memory |
<> | 128:9bcdf88f62b0 | 137 | * section. This provides stack overflow detection. */ |
<> | 128:9bcdf88f62b0 | 138 | .stack (NOLOAD): |
<> | 128:9bcdf88f62b0 | 139 | { |
<> | 128:9bcdf88f62b0 | 140 | __StackLimit = .; |
<> | 128:9bcdf88f62b0 | 141 | *(.stack*); |
<> | 128:9bcdf88f62b0 | 142 | . += StackSize - (. - __StackLimit); |
<> | 128:9bcdf88f62b0 | 143 | } > RAM_INTERN |
<> | 128:9bcdf88f62b0 | 144 | |
<> | 128:9bcdf88f62b0 | 145 | /* Set stack top to end of RAM, and stack limit move down by |
<> | 128:9bcdf88f62b0 | 146 | * size of stack_dummy section */ |
<> | 128:9bcdf88f62b0 | 147 | __StackTop = ADDR(.stack) + SIZEOF(.stack); |
<> | 128:9bcdf88f62b0 | 148 | __StackLimit = ADDR(.stack); |
<> | 128:9bcdf88f62b0 | 149 | PROVIDE(__stack = __StackTop); |
<> | 128:9bcdf88f62b0 | 150 | |
<> | 128:9bcdf88f62b0 | 151 | /* Relocate vector table in SRAM */ |
<> | 128:9bcdf88f62b0 | 152 | .isr_vector.reloc (NOLOAD) : |
<> | 128:9bcdf88f62b0 | 153 | { |
<> | 128:9bcdf88f62b0 | 154 | . = ALIGN(1 << LOG2CEIL(__vector_size)); |
<> | 128:9bcdf88f62b0 | 155 | PROVIDE(__start_vector_table__ = .); |
<> | 128:9bcdf88f62b0 | 156 | . += __vector_size; |
<> | 128:9bcdf88f62b0 | 157 | PROVIDE(__end_vector_table__ = .); |
<> | 128:9bcdf88f62b0 | 158 | } > RAM_INTERN |
<> | 128:9bcdf88f62b0 | 159 | |
<> | 128:9bcdf88f62b0 | 160 | .data : |
<> | 128:9bcdf88f62b0 | 161 | { |
<> | 128:9bcdf88f62b0 | 162 | PROVIDE( __etext = LOADADDR(.data) ); |
<> | 128:9bcdf88f62b0 | 163 | |
<> | 128:9bcdf88f62b0 | 164 | __data_start__ = .; |
<> | 128:9bcdf88f62b0 | 165 | *(vtable) |
<> | 128:9bcdf88f62b0 | 166 | *(.data*) |
<> | 128:9bcdf88f62b0 | 167 | |
<> | 128:9bcdf88f62b0 | 168 | . = ALIGN(4); |
<> | 128:9bcdf88f62b0 | 169 | /* preinit data */ |
<> | 128:9bcdf88f62b0 | 170 | PROVIDE_HIDDEN (__preinit_array_start = .); |
<> | 128:9bcdf88f62b0 | 171 | KEEP(*(.preinit_array)) |
<> | 128:9bcdf88f62b0 | 172 | PROVIDE_HIDDEN (__preinit_array_end = .); |
<> | 128:9bcdf88f62b0 | 173 | |
<> | 128:9bcdf88f62b0 | 174 | . = ALIGN(4); |
<> | 128:9bcdf88f62b0 | 175 | /* init data */ |
<> | 128:9bcdf88f62b0 | 176 | PROVIDE_HIDDEN (__init_array_start = .); |
<> | 128:9bcdf88f62b0 | 177 | KEEP(*(SORT(.init_array.*))) |
<> | 128:9bcdf88f62b0 | 178 | KEEP(*(.init_array)) |
<> | 128:9bcdf88f62b0 | 179 | PROVIDE_HIDDEN (__init_array_end = .); |
<> | 128:9bcdf88f62b0 | 180 | |
<> | 128:9bcdf88f62b0 | 181 | . = ALIGN(4); |
<> | 128:9bcdf88f62b0 | 182 | /* finit data */ |
<> | 128:9bcdf88f62b0 | 183 | PROVIDE_HIDDEN (__fini_array_start = .); |
<> | 128:9bcdf88f62b0 | 184 | KEEP(*(SORT(.fini_array.*))) |
<> | 128:9bcdf88f62b0 | 185 | KEEP(*(.fini_array)) |
<> | 128:9bcdf88f62b0 | 186 | PROVIDE_HIDDEN (__fini_array_end = .); |
<> | 128:9bcdf88f62b0 | 187 | |
<> | 128:9bcdf88f62b0 | 188 | /* All data end */ |
<> | 128:9bcdf88f62b0 | 189 | . = ALIGN(32); |
<> | 128:9bcdf88f62b0 | 190 | __data_end__ = .; |
<> | 128:9bcdf88f62b0 | 191 | |
<> | 128:9bcdf88f62b0 | 192 | } >RAM_INTERN AT>FLASH |
<> | 128:9bcdf88f62b0 | 193 | |
<> | 128:9bcdf88f62b0 | 194 | /* uvisor configuration data */ |
<> | 128:9bcdf88f62b0 | 195 | .uvisor.secure : |
<> | 128:9bcdf88f62b0 | 196 | { |
<> | 128:9bcdf88f62b0 | 197 | . = ALIGN(32); |
<> | 128:9bcdf88f62b0 | 198 | __uvisor_secure_start = .; |
<> | 128:9bcdf88f62b0 | 199 | |
<> | 128:9bcdf88f62b0 | 200 | /* uvisor secure boxes configuration tables */ |
<> | 128:9bcdf88f62b0 | 201 | . = ALIGN(32); |
<> | 128:9bcdf88f62b0 | 202 | __uvisor_cfgtbl_start = .; |
<> | 128:9bcdf88f62b0 | 203 | KEEP(*(.keep.uvisor.cfgtbl)) |
<> | 128:9bcdf88f62b0 | 204 | . = ALIGN(32); |
<> | 128:9bcdf88f62b0 | 205 | __uvisor_cfgtbl_end = .; |
<> | 128:9bcdf88f62b0 | 206 | |
<> | 128:9bcdf88f62b0 | 207 | /* pointers to uvisor secure boxes configuration tables */ |
<> | 128:9bcdf88f62b0 | 208 | /* note: no further alignment here, we need to have the exact list of pointers */ |
<> | 128:9bcdf88f62b0 | 209 | __uvisor_cfgtbl_ptr_start = .; |
<> | 128:9bcdf88f62b0 | 210 | KEEP(*(.keep.uvisor.cfgtbl_ptr_first)) |
<> | 128:9bcdf88f62b0 | 211 | KEEP(*(.keep.uvisor.cfgtbl_ptr)) |
<> | 128:9bcdf88f62b0 | 212 | __uvisor_cfgtbl_ptr_end = .; |
<> | 128:9bcdf88f62b0 | 213 | |
<> | 128:9bcdf88f62b0 | 214 | /* the following symbols are kept for backward compatibility and will be soon |
<> | 128:9bcdf88f62b0 | 215 | * deprecated; applications actively using uVisor (__uvisor_mode == UVISOR_ENABLED) |
<> | 128:9bcdf88f62b0 | 216 | * will need to use uVisor 0.8.x or above, or the security assertions will halt the |
<> | 128:9bcdf88f62b0 | 217 | * system */ |
<> | 128:9bcdf88f62b0 | 218 | /************************/ |
<> | 128:9bcdf88f62b0 | 219 | __uvisor_data_src = .; |
<> | 128:9bcdf88f62b0 | 220 | __uvisor_data_start = .; |
<> | 128:9bcdf88f62b0 | 221 | __uvisor_data_end = .; |
<> | 128:9bcdf88f62b0 | 222 | /************************/ |
<> | 128:9bcdf88f62b0 | 223 | |
<> | 128:9bcdf88f62b0 | 224 | . = ALIGN(32); |
<> | 128:9bcdf88f62b0 | 225 | __uvisor_secure_end = .; |
<> | 128:9bcdf88f62b0 | 226 | } >FLASH |
<> | 128:9bcdf88f62b0 | 227 | |
<> | 128:9bcdf88f62b0 | 228 | .uninitialized (NOLOAD): |
<> | 128:9bcdf88f62b0 | 229 | { |
<> | 128:9bcdf88f62b0 | 230 | . = ALIGN(32); |
<> | 128:9bcdf88f62b0 | 231 | __uninitialized_start = .; |
<> | 128:9bcdf88f62b0 | 232 | *(.uninitialized) |
<> | 128:9bcdf88f62b0 | 233 | KEEP(*(.keep.uninitialized)) |
<> | 128:9bcdf88f62b0 | 234 | . = ALIGN(32); |
<> | 128:9bcdf88f62b0 | 235 | __uninitialized_end = .; |
<> | 128:9bcdf88f62b0 | 236 | } > RAM_INTERN |
<> | 128:9bcdf88f62b0 | 237 | |
<> | 128:9bcdf88f62b0 | 238 | .bss (NOLOAD): |
<> | 128:9bcdf88f62b0 | 239 | { |
<> | 128:9bcdf88f62b0 | 240 | __bss_start__ = .; |
<> | 128:9bcdf88f62b0 | 241 | *(.bss*) |
<> | 128:9bcdf88f62b0 | 242 | *(COMMON) |
<> | 128:9bcdf88f62b0 | 243 | __bss_end__ = .; |
<> | 128:9bcdf88f62b0 | 244 | } > RAM_INTERN |
<> | 128:9bcdf88f62b0 | 245 | |
<> | 128:9bcdf88f62b0 | 246 | .heap (NOLOAD): |
<> | 128:9bcdf88f62b0 | 247 | { |
<> | 128:9bcdf88f62b0 | 248 | __end__ = .; |
<> | 128:9bcdf88f62b0 | 249 | end = __end__; |
<> | 128:9bcdf88f62b0 | 250 | *(.heap*); |
<> | 128:9bcdf88f62b0 | 251 | . += (ORIGIN(RAM_INTERN) + LENGTH(RAM_INTERN) - .); |
<> | 128:9bcdf88f62b0 | 252 | __HeapLimit = .; |
<> | 128:9bcdf88f62b0 | 253 | } > RAM_INTERN |
<> | 128:9bcdf88f62b0 | 254 | PROVIDE(__heap_size = SIZEOF(.heap)); |
<> | 128:9bcdf88f62b0 | 255 | PROVIDE(__mbed_sbrk_start = ADDR(.heap)); |
<> | 128:9bcdf88f62b0 | 256 | PROVIDE(__mbed_krbs_start = ADDR(.heap) + SIZEOF(.heap)); |
<> | 128:9bcdf88f62b0 | 257 | |
<> | 128:9bcdf88f62b0 | 258 | /* Provide physical memory boundaries for uVisor. */ |
<> | 128:9bcdf88f62b0 | 259 | __uvisor_flash_start = ORIGIN(VECTORS); |
<> | 128:9bcdf88f62b0 | 260 | __uvisor_flash_end = ORIGIN(FLASH) + LENGTH(FLASH); |
<> | 128:9bcdf88f62b0 | 261 | __uvisor_sram_start = ORIGIN(RAM_INTERN); |
<> | 128:9bcdf88f62b0 | 262 | __uvisor_sram_end = ORIGIN(RAM_INTERN) + LENGTH(RAM_INTERN); |
<> | 128:9bcdf88f62b0 | 263 | } |