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 */
11 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x08000 /* 32k */
14 /* Library configurations */
15 GROUP(libgcc.a libc.a libm.a libnosys.a)
17 /* Linker script to place sections and symbol values. Should be used together
18 * with other linker script that defines memory regions FLASH and RAM.
19 * It references following symbols, which must be defined in code:
20 * Reset_Handler : Entry of reset handler
22 * It defines following symbols, which code can use without definition:
27 * __preinit_array_start
53 __Vectors_Size = __Vectors_End - __Vectors;
64 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
71 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
82 *(.ARM.extab* .gnu.linkonce.armextab.*)
88 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
102 PROVIDE_HIDDEN (__preinit_array_start = .);
103 KEEP(*(.preinit_array))
104 PROVIDE_HIDDEN (__preinit_array_end = .);
108 PROVIDE_HIDDEN (__init_array_start = .);
109 KEEP(*(SORT(.init_array.*)))
111 PROVIDE_HIDDEN (__init_array_end = .);
116 PROVIDE_HIDDEN (__fini_array_start = .);
117 KEEP(*(SORT(.fini_array.*)))
119 PROVIDE_HIDDEN (__fini_array_end = .);
147 /* .stack_dummy section doesn't contains any symbols. It is only
148 * used for linker to calculate size of stack sections, and assign
149 * values to stack symbols later */
155 /* Set stack top to end of RAM, and stack limit move down by
156 * size of stack_dummy section */
157 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
158 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
159 PROVIDE(__stack = __StackTop);
161 /* Check if data + heap + stack exceeds RAM limit */
162 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")