]> git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KLXX/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/MKL05Z4.ld
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
[tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_Freescale / TARGET_KLXX / TARGET_KL05Z / TOOLCHAIN_GCC_ARM / MKL05Z4.ld
1 /*
2 * KL05Z ARM GCC linker script file, Martin Kojtal (0xc0170)
3 */
4
5 MEMORY
6 {
7 VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000410
8 FLASH (rx) : ORIGIN = 0x00000410, LENGTH = 32K - 0x00000410
9 RAM (rwx) : ORIGIN = 0x1FFFFCC0, LENGTH = 4K - 0xC0
10 }
11
12 /* Linker script to place sections and symbol values. Should be used together
13 * with other linker script that defines memory regions FLASH and RAM.
14 * It references following symbols, which must be defined in code:
15 * _reset_init : Entry of reset handler
16 *
17 * It defines following symbols, which code can use without definition:
18 * __exidx_start
19 * __exidx_end
20 * __etext
21 * __data_start__
22 * __preinit_array_start
23 * __preinit_array_end
24 * __init_array_start
25 * __init_array_end
26 * __fini_array_start
27 * __fini_array_end
28 * __data_end__
29 * __bss_start__
30 * __bss_end__
31 * __end__
32 * end
33 * __HeapLimit
34 * __StackLimit
35 * __StackTop
36 * __stack
37 */
38 ENTRY(Reset_Handler)
39
40 SECTIONS
41 {
42 .isr_vector :
43 {
44 __vector_table = .;
45 KEEP(*(.vector_table))
46 . = ALIGN(4);
47 } > VECTORS
48
49 .text :
50 {
51 *(.text*)
52
53 KEEP(*(.init))
54 KEEP(*(.fini))
55
56 /* .ctors */
57 *crtbegin.o(.ctors)
58 *crtbegin?.o(.ctors)
59 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
60 *(SORT(.ctors.*))
61 *(.ctors)
62
63 /* .dtors */
64 *crtbegin.o(.dtors)
65 *crtbegin?.o(.dtors)
66 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
67 *(SORT(.dtors.*))
68 *(.dtors)
69
70 *(.rodata*)
71
72 KEEP(*(.eh_frame*))
73 } > FLASH
74
75 .ARM.extab :
76 {
77 *(.ARM.extab* .gnu.linkonce.armextab.*)
78 } > FLASH
79
80 __exidx_start = .;
81 .ARM.exidx :
82 {
83 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
84 } > FLASH
85 __exidx_end = .;
86
87 __etext = .;
88
89 .data : AT (__etext)
90 {
91 __data_start__ = .;
92 *(vtable)
93 *(.data*)
94
95 . = ALIGN(4);
96 /* preinit data */
97 PROVIDE_HIDDEN (__preinit_array_start = .);
98 KEEP(*(.preinit_array))
99 PROVIDE_HIDDEN (__preinit_array_end = .);
100
101 . = ALIGN(4);
102 /* init data */
103 PROVIDE_HIDDEN (__init_array_start = .);
104 KEEP(*(SORT(.init_array.*)))
105 KEEP(*(.init_array))
106 PROVIDE_HIDDEN (__init_array_end = .);
107
108
109 . = ALIGN(4);
110 /* finit data */
111 PROVIDE_HIDDEN (__fini_array_start = .);
112 KEEP(*(SORT(.fini_array.*)))
113 KEEP(*(.fini_array))
114 PROVIDE_HIDDEN (__fini_array_end = .);
115
116 . = ALIGN(4);
117 /* All data end */
118 __data_end__ = .;
119
120 } > RAM
121
122 .bss :
123 {
124 __bss_start__ = .;
125 *(.bss*)
126 *(COMMON)
127 __bss_end__ = .;
128 } > RAM
129
130 .heap :
131 {
132 __end__ = .;
133 end = __end__;
134 *(.heap*)
135 __HeapLimit = .;
136 } > RAM
137
138 /* .stack_dummy section doesn't contains any symbols. It is only
139 * used for linker to calculate size of stack sections, and assign
140 * values to stack symbols later */
141 .stack_dummy :
142 {
143 *(.stack)
144 } > RAM
145
146 /* Set stack top to end of RAM, and stack limit move down by
147 * size of stack_dummy section */
148 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
149 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
150 PROVIDE(__stack = __StackTop);
151
152 /* Check if data + heap + stack exceeds RAM limit */
153 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
154 }
Imprint / Impressum