]> git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/TOOLCHAIN_GCC_CW_EWL/MKL25Z4.ld
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
[tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_Freescale / TARGET_KLXX / TARGET_KL25Z / TOOLCHAIN_GCC_CW_EWL / MKL25Z4.ld
1 /*
2 *****************************************************************************
3 **
4 ** File : KL25Z128M4_flash.ld
5 **
6 ** Default linker command file for Flash targets
7 **
8 *****************************************************************************
9 */
10 /* Entry Point */
11 ENTRY(__thumb_startup)
12
13 /* Highest address of the user mode stack */
14 _estack = 0x20003000; /* end of SRAM */
15 __SP_INIT = _estack;
16
17 /* Generate a link error if heap and stack don't fit into RAM */
18 __heap_size = 0x400; /* required amount of heap */
19 __stack_size = 0x400; /* required amount of stack */
20
21 /* Specify the memory areas */
22 MEMORY
23 {
24 m_interrupts (rx) : ORIGIN = 0x00000000, LENGTH = 0xC0
25 m_cfmprotrom (rx) : ORIGIN = 0x00000400, LENGTH = 0x10
26 m_text (rx) : ORIGIN = 0x00000800, LENGTH = 128K - 0x800
27 m_data (rwx) : ORIGIN = 0x1FFFF000, LENGTH = 16K /* SRAM */
28 }
29
30
31 /* Define output sections */
32 SECTIONS
33 {
34 /* The startup code goes first into Flash */
35 .interrupts :
36 {
37 __vector_table = .;
38 . = ALIGN(4);
39 KEEP(*(.vectortable)) /* Startup code */
40 . = ALIGN(4);
41 } > m_interrupts
42
43 .cfmprotect :
44 {
45 . = ALIGN(4);
46 KEEP(*(.cfmconfig)) /* Flash Configuration Field (FCF) */
47 . = ALIGN(4);
48 } > m_cfmprotrom
49
50 /* The program code and other data goes into Flash */
51 .text :
52 {
53 . = ALIGN(4);
54 *(.text) /* .text sections (code) */
55 *(.text*) /* .text* sections (code) */
56 *(.rodata) /* .rodata sections (constants, strings, etc.) */
57 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
58 *(.glue_7) /* glue arm to thumb code */
59 *(.glue_7t) /* glue thumb to arm code */
60 *(.eh_frame)
61
62 KEEP (*(.init))
63 KEEP (*(.fini))
64
65 . = ALIGN(4);
66 _etext = .; /* define a global symbols at end of code */
67 } > m_text
68
69 .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } > m_text
70 .ARM : {
71 __exidx_start = .;
72 *(.ARM.exidx*)
73 __exidx_end = .;
74 } > m_text
75
76 .ctors :
77 {
78 __CTOR_LIST__ = .;
79 /* gcc uses crtbegin.o to find the start of
80 the constructors, so we make sure it is
81 first. Because this is a wildcard, it
82 doesn't matter if the user does not
83 actually link against crtbegin.o; the
84 linker won't look for a file to match a
85 wildcard. The wildcard also means that it
86 doesn't matter which directory crtbegin.o
87 is in. */
88 KEEP (*crtbegin.o(.ctors))
89 /* We don't want to include the .ctor section from
90 from the crtend.o file until after the sorted ctors.
91 The .ctor section from the crtend file contains the
92 end of ctors marker and it must be last */
93 KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
94 KEEP (*(SORT(.ctors.*)))
95 KEEP (*(.ctors))
96 __CTOR_END__ = .;
97 } > m_text
98 .dtors :
99 {
100 __DTOR_LIST__ = .;
101 KEEP (*crtbegin.o(.dtors))
102 KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
103 KEEP (*(SORT(.dtors.*)))
104 KEEP (*(.dtors))
105 __DTOR_END__ = .;
106 } > m_text
107
108 .preinit_array :
109 {
110 PROVIDE_HIDDEN (__preinit_array_start = .);
111 KEEP (*(.preinit_array*))
112 PROVIDE_HIDDEN (__preinit_array_end = .);
113 } > m_text
114 .init_array :
115 {
116 PROVIDE_HIDDEN (__init_array_start = .);
117 KEEP (*(SORT(.init_array.*)))
118 KEEP (*(.init_array*))
119 PROVIDE_HIDDEN (__init_array_end = .);
120 } > m_text
121 .fini_array :
122 {
123 PROVIDE_HIDDEN (__fini_array_start = .);
124 KEEP (*(SORT(.fini_array.*)))
125 KEEP (*(.fini_array*))
126 PROVIDE_HIDDEN (__fini_array_end = .);
127
128 ___ROM_AT = .;
129 } > m_text
130
131 /* reserve MTB memory at the beginning of m_data */
132 .mtb : /* MTB buffer address as defined by the hardware */
133 {
134 . = ALIGN(8);
135 _mtb_start = .;
136 KEEP(*(.mtb_buf)) /* need to KEEP Micro Trace Buffer as not referenced by application */
137 . = ALIGN(8);
138 _mtb_end = .;
139 } > m_data
140
141 /* Initialized data sections goes into RAM, load LMA copy after code */
142 .data : AT(___ROM_AT)
143 {
144 . = ALIGN(4);
145 __sinit__ = .;
146 _sdata = .; /* create a global symbol at data start */
147 *(.data) /* .data sections */
148 *(.data*) /* .data* sections */
149
150 . = ALIGN(4);
151 _edata = .; /* define a global symbol at data end */
152 } > m_data
153
154 ___data_size = _edata - _sdata;
155
156 /* Uninitialized data section */
157 . = ALIGN(4);
158 .bss :
159 {
160 /* This is used by the startup in order to initialize the .bss section */
161 __START_BSS = .;
162 PROVIDE ( __bss_start__ = __START_BSS );
163 *(.bss)
164 *(.bss*)
165 *(COMMON)
166
167 . = ALIGN(4);
168 __END_BSS = .;
169 PROVIDE ( __bss_end__ = __END_BSS );
170 } > m_data
171
172 _romp_at = ___ROM_AT + SIZEOF(.data);
173 .romp : AT(_romp_at)
174 {
175 __S_romp = _romp_at;
176 LONG(___ROM_AT);
177 LONG(_sdata);
178 LONG(___data_size);
179 LONG(0);
180 LONG(0);
181 LONG(0);
182 } > m_data
183
184 /* User_heap_stack section, used to check that there is enough RAM left */
185 ._user_heap_stack :
186 {
187 . = ALIGN(4);
188 PROVIDE ( end = . );
189 PROVIDE ( _end = . );
190 __heap_addr = .;
191 . = . + __heap_size;
192 . = . + __stack_size;
193 . = ALIGN(4);
194 } > m_data
195
196 .ARM.attributes 0 : { *(.ARM.attributes) }
197 }
Imprint / Impressum