mbed library sources. Supersedes mbed-src.

Fork of mbed-dev by mbed official

Committer:
<>
Date:
Fri Oct 28 11:17:30 2016 +0100
Revision:
149:156823d33999
Child:
151:5eaa88a5bcc7
This updates the lib to the mbed lib v128

NOTE: This release includes a restructuring of the file and directory locations and thus some
include paths in your code may need updating accordingly.

Who changed what in which revision?

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