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:
25 * __copy_table_start__
27 * __zero_table_start__
31 * __preinit_array_start
57 __Vectors_Size = __Vectors_End - __Vectors;
68 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
75 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
86 *(.ARM.extab* .gnu.linkonce.armextab.*)
92 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
96 /* To copy multiple ROM to RAM sections,
97 * uncomment .copy.table section and,
98 * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
103 __copy_table_start__ = .;
105 LONG (__data_start__)
106 LONG (__data_end__ - __data_start__)
108 LONG (__data2_start__)
109 LONG (__data2_end__ - __data2_start__)
110 __copy_table_end__ = .;
114 /* To clear multiple BSS sections,
115 * uncomment .zero.table section and,
116 * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
121 __zero_table_start__ = .;
123 LONG (__bss_end__ - __bss_start__)
124 LONG (__bss2_start__)
125 LONG (__bss2_end__ - __bss2_start__)
126 __zero_table_end__ = .;
140 PROVIDE_HIDDEN (__preinit_array_start = .);
141 KEEP(*(.preinit_array))
142 PROVIDE_HIDDEN (__preinit_array_end = .);
146 PROVIDE_HIDDEN (__init_array_start = .);
147 KEEP(*(SORT(.init_array.*)))
149 PROVIDE_HIDDEN (__init_array_end = .);
154 PROVIDE_HIDDEN (__fini_array_start = .);
155 KEEP(*(SORT(.fini_array.*)))
157 PROVIDE_HIDDEN (__fini_array_end = .);
185 /* .stack_dummy section doesn't contains any symbols. It is only
186 * used for linker to calculate size of stack sections, and assign
187 * values to stack symbols later */
193 /* Set stack top to end of RAM, and stack limit move down by
194 * size of stack_dummy section */
195 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
196 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
197 PROVIDE(__stack = __StackTop);
199 /* Check if data + heap + stack exceeds RAM limit */
200 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")