1 /* Linker script to configure memory regions. */
5 FLASH (rx) : ORIGIN = 0x00018000, LENGTH = 0x28000
6 RAM (rwx) : ORIGIN = 0x20002000, LENGTH = 0x6000
9 OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
11 /* Linker script to place sections and symbol values. Should be used together
12 * with other linker script that defines memory regions FLASH and RAM.
13 * It references following symbols, which must be defined in code:
14 * Reset_Handler : Entry of reset handler
16 * It defines following symbols, which code can use without definition:
21 * __preinit_array_start
52 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
59 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
71 *(.ARM.extab* .gnu.linkonce.armextab.*)
77 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
91 PROVIDE_HIDDEN (__preinit_array_start = .);
92 KEEP(*(.preinit_array))
93 PROVIDE_HIDDEN (__preinit_array_end = .);
97 PROVIDE_HIDDEN (__init_array_start = .);
98 KEEP(*(SORT(.init_array.*)))
100 PROVIDE_HIDDEN (__init_array_end = .);
105 PROVIDE_HIDDEN (__fini_array_start = .);
106 KEEP(*(SORT(.fini_array.*)))
108 PROVIDE_HIDDEN (__fini_array_end = .);
135 /* .stack_dummy section doesn't contains any symbols. It is only
136 * used for linker to calculate size of stack sections, and assign
137 * values to stack symbols later */
143 /* Set stack top to end of RAM, and stack limit move down by
144 * size of stack_dummy section */
145 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
146 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
147 PROVIDE(__stack = __StackTop);
149 /* Check if data + heap + stack exceeds RAM limit */
150 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")