2 * CMSIS/Device/ARM/ARMCM0plus/Source/GCC/gcc_arm.ld
4 * git://github.com/ARM-software/CMSIS
7 /* Linker script to configure memory regions. */
10 FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x40000 /* 256k */
13 : ORIGIN = 0x1fffe000, LENGTH = 0x08000
16 /* Library configurations */
17 GROUP(libgcc.a libc.a libm.a libnosys.a)
19 /* Linker script to place sections and symbol values. Should be used together
20 * with other linker script that defines memory regions FLASH and RAM.
21 * It references following symbols, which must be defined in code:
22 * Reset_Handler : Entry of reset handler
24 * It defines following symbols, which code can use without definition:
29 * __preinit_array_start
62 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
69 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
80 *(.ARM.extab* .gnu.linkonce.armextab.*)
86 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
100 PROVIDE_HIDDEN (__preinit_array_start = .);
101 KEEP(*(.preinit_array))
102 PROVIDE_HIDDEN (__preinit_array_end = .);
106 PROVIDE_HIDDEN (__init_array_start = .);
107 KEEP(*(SORT(.init_array.*)))
109 PROVIDE_HIDDEN (__init_array_end = .);
114 PROVIDE_HIDDEN (__fini_array_start = .);
115 KEEP(*(SORT(.fini_array.*)))
117 PROVIDE_HIDDEN (__fini_array_end = .);
145 /* .stack_dummy section doesn't contains any symbols. It is only
146 * used for linker to calculate size of stack sections, and assign
147 * values to stack symbols later */
153 /* Set stack top to end of RAM, and stack limit move down by
154 * size of stack_dummy section */
155 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
156 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
157 PROVIDE(__stack = __StackTop);
159 /* Check if data + heap + stack exceeds RAM limit */
160 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")