2 * Linker script for Massdrop Infinity
3 * Infinity has bootloader in top 4KB sector of flash and app should be placed after the area.
5 * based on mbed.org K20 ARM GCC linker script file: MK20D5.ld
10 /* Infinity blootloader uses 4KB */
11 FLASH (rx) : ORIGIN = 4K, LENGTH = 128K - 4K
12 RAM (rwx) : ORIGIN = 0x1FFFE0F8, LENGTH = 16K - 0xF8
15 /* Linker script to place sections and symbol values. Should be used together
16 * with other linker script that defines memory regions FLASH and RAM.
17 * It references following symbols, which must be defined in code:
18 * _reset_init : Entry of reset handler
20 * It defines following symbols, which code can use without definition:
25 * __preinit_array_start
49 *(.text.Reset_Handler)
61 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
68 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
79 *(.ARM.extab* .gnu.linkonce.armextab.*)
85 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
99 PROVIDE_HIDDEN (__preinit_array_start = .);
100 KEEP(*(.preinit_array))
101 PROVIDE_HIDDEN (__preinit_array_end = .);
105 PROVIDE_HIDDEN (__init_array_start = .);
106 KEEP(*(SORT(.init_array.*)))
108 PROVIDE_HIDDEN (__init_array_end = .);
113 PROVIDE_HIDDEN (__fini_array_start = .);
114 KEEP(*(SORT(.fini_array.*)))
116 PROVIDE_HIDDEN (__fini_array_end = .);
140 /* .stack_dummy section doesn't contains any symbols. It is only
141 * used for linker to calculate size of stack sections, and assign
142 * values to stack symbols later */
148 /* Set stack top to end of RAM, and stack limit move down by
149 * size of stack_dummy section */
150 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
151 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
152 PROVIDE(__stack = __StackTop);
154 /* Check if data + heap + stack exceeds RAM limit */
155 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")