1 /* Linker script for mbed LPC1768 */
3 /* Linker script to configure memory regions. */
6 FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 128K
7 RAM (rwx) : ORIGIN = 0x1FFFF0C0, LENGTH = 0x3F40
10 /* Linker script to place sections and symbol values. Should be used together
11 * with other linker script that defines memory regions FLASH and RAM.
12 * It references following symbols, which must be defined in code:
13 * Reset_Handler : Entry of reset handler
15 * It defines following symbols, which code can use without definition:
20 * __preinit_array_start
43 *(.text.Reset_Handler)
46 /* Only vectors and code running at reset are safe to be in first 512
47 bytes since RAM can be mapped into this area for RAM based interrupt
58 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
65 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
76 *(.ARM.extab* .gnu.linkonce.armextab.*)
82 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
96 PROVIDE (__preinit_array_start = .);
97 KEEP(*(.preinit_array))
98 PROVIDE (__preinit_array_end = .);
102 PROVIDE (__init_array_start = .);
103 KEEP(*(SORT(.init_array.*)))
105 PROVIDE (__init_array_end = .);
110 PROVIDE (__fini_array_start = .);
111 KEEP(*(SORT(.fini_array.*)))
113 PROVIDE (__fini_array_end = .);
137 /* .stack_dummy section doesn't contains any symbols. It is only
138 * used for linker to calculate size of stack sections, and assign
139 * values to stack symbols later */
145 /* Set stack top to end of RAM, and stack limit move down by
146 * size of stack_dummy section */
147 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
148 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
149 PROVIDE(__stack = __StackTop);
151 /* Check if data + heap + stack exceeds RAM limit */
152 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")