2 * KL46Z ARM GCC linker script file
7 VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000400
8 FLASH_PROTECTION (rx) : ORIGIN = 0x00000400, LENGTH = 0x00000010
9 FLASH (rx) : ORIGIN = 0x00000410, LENGTH = 256K - 0x00000410
10 RAM (rwx) : ORIGIN = 0x1FFFE0C0, LENGTH = 32K - 0xC0
13 /* Linker script to place sections and symbol values. Should be used together
14 * with other linker script that defines memory regions FLASH and RAM.
15 * It references following symbols, which must be defined in code:
16 * _reset_init : Entry of reset handler
18 * It defines following symbols, which code can use without definition:
23 * __preinit_array_start
46 KEEP(*(.vector_table))
47 *(.text.Reset_Handler)
54 KEEP(*(.kinetis_flash_config_field))
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.*)
106 PROVIDE_HIDDEN (__preinit_array_start = .);
107 KEEP(*(.preinit_array))
108 PROVIDE_HIDDEN (__preinit_array_end = .);
112 PROVIDE_HIDDEN (__init_array_start = .);
113 KEEP(*(SORT(.init_array.*)))
115 PROVIDE_HIDDEN (__init_array_end = .);
120 PROVIDE_HIDDEN (__fini_array_start = .);
121 KEEP(*(SORT(.fini_array.*)))
123 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")