diff options
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/devices/K32L2A31A/gcc/K32L2A31xxxxA_flash.ld')
-rw-r--r-- | lib/chibios-contrib/ext/mcux-sdk/devices/K32L2A31A/gcc/K32L2A31xxxxA_flash.ld | 227 |
1 files changed, 227 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/K32L2A31A/gcc/K32L2A31xxxxA_flash.ld b/lib/chibios-contrib/ext/mcux-sdk/devices/K32L2A31A/gcc/K32L2A31xxxxA_flash.ld new file mode 100644 index 000000000..966993507 --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/devices/K32L2A31A/gcc/K32L2A31xxxxA_flash.ld | |||
@@ -0,0 +1,227 @@ | |||
1 | /* | ||
2 | ** ################################################################### | ||
3 | ** Processors: K32L2A31VLH1A | ||
4 | ** K32L2A31VLL1A | ||
5 | ** | ||
6 | ** Compiler: GNU C Compiler | ||
7 | ** Reference manual: K32L2AxRM, Rev. 1, 12/2019 | ||
8 | ** Version: rev. 1.0, 2019-10-30 | ||
9 | ** Build: b191218 | ||
10 | ** | ||
11 | ** Abstract: | ||
12 | ** Linker file for the GNU C Compiler | ||
13 | ** | ||
14 | ** Copyright 2016 Freescale Semiconductor, Inc. | ||
15 | ** Copyright 2016-2019 NXP | ||
16 | ** All rights reserved. | ||
17 | ** | ||
18 | ** SPDX-License-Identifier: BSD-3-Clause | ||
19 | ** | ||
20 | ** http: www.nxp.com | ||
21 | ** mail: [email protected] | ||
22 | ** | ||
23 | ** ################################################################### | ||
24 | */ | ||
25 | |||
26 | /* Entry Point */ | ||
27 | ENTRY(Reset_Handler) | ||
28 | |||
29 | HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400; | ||
30 | STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400; | ||
31 | |||
32 | /* Specify the memory areas */ | ||
33 | MEMORY | ||
34 | { | ||
35 | m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000140 | ||
36 | m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010 | ||
37 | m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0003FBF0 | ||
38 | m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00020000 | ||
39 | m_usb_sram (RW) : ORIGIN = 0x40100000, LENGTH = 0x00000800 | ||
40 | } | ||
41 | |||
42 | /* Define output sections */ | ||
43 | SECTIONS | ||
44 | { | ||
45 | /* The startup code goes first into internal flash */ | ||
46 | .interrupts : | ||
47 | { | ||
48 | . = ALIGN(4); | ||
49 | KEEP(*(.isr_vector)) /* Startup code */ | ||
50 | . = ALIGN(4); | ||
51 | } > m_interrupts | ||
52 | |||
53 | .flash_config : | ||
54 | { | ||
55 | . = ALIGN(4); | ||
56 | KEEP(*(.FlashConfig)) /* Flash Configuration Field (FCF) */ | ||
57 | . = ALIGN(4); | ||
58 | } > m_flash_config | ||
59 | |||
60 | /* The program code and other data goes into internal flash */ | ||
61 | .text : | ||
62 | { | ||
63 | . = ALIGN(4); | ||
64 | *(.text) /* .text sections (code) */ | ||
65 | *(.text*) /* .text* sections (code) */ | ||
66 | *(.rodata) /* .rodata sections (constants, strings, etc.) */ | ||
67 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ | ||
68 | *(.glue_7) /* glue arm to thumb code */ | ||
69 | *(.glue_7t) /* glue thumb to arm code */ | ||
70 | *(.eh_frame) | ||
71 | KEEP (*(.init)) | ||
72 | KEEP (*(.fini)) | ||
73 | . = ALIGN(4); | ||
74 | } > m_text | ||
75 | |||
76 | .ARM.extab : | ||
77 | { | ||
78 | *(.ARM.extab* .gnu.linkonce.armextab.*) | ||
79 | } > m_text | ||
80 | |||
81 | .ARM : | ||
82 | { | ||
83 | __exidx_start = .; | ||
84 | *(.ARM.exidx*) | ||
85 | __exidx_end = .; | ||
86 | } > m_text | ||
87 | |||
88 | .ctors : | ||
89 | { | ||
90 | __CTOR_LIST__ = .; | ||
91 | /* gcc uses crtbegin.o to find the start of | ||
92 | the constructors, so we make sure it is | ||
93 | first. Because this is a wildcard, it | ||
94 | doesn't matter if the user does not | ||
95 | actually link against crtbegin.o; the | ||
96 | linker won't look for a file to match a | ||
97 | wildcard. The wildcard also means that it | ||
98 | doesn't matter which directory crtbegin.o | ||
99 | is in. */ | ||
100 | KEEP (*crtbegin.o(.ctors)) | ||
101 | KEEP (*crtbegin?.o(.ctors)) | ||
102 | /* We don't want to include the .ctor section from | ||
103 | from the crtend.o file until after the sorted ctors. | ||
104 | The .ctor section from the crtend file contains the | ||
105 | end of ctors marker and it must be last */ | ||
106 | KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)) | ||
107 | KEEP (*(SORT(.ctors.*))) | ||
108 | KEEP (*(.ctors)) | ||
109 | __CTOR_END__ = .; | ||
110 | } > m_text | ||
111 | |||
112 | .dtors : | ||
113 | { | ||
114 | __DTOR_LIST__ = .; | ||
115 | KEEP (*crtbegin.o(.dtors)) | ||
116 | KEEP (*crtbegin?.o(.dtors)) | ||
117 | KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)) | ||
118 | KEEP (*(SORT(.dtors.*))) | ||
119 | KEEP (*(.dtors)) | ||
120 | __DTOR_END__ = .; | ||
121 | } > m_text | ||
122 | |||
123 | .preinit_array : | ||
124 | { | ||
125 | PROVIDE_HIDDEN (__preinit_array_start = .); | ||
126 | KEEP (*(.preinit_array*)) | ||
127 | PROVIDE_HIDDEN (__preinit_array_end = .); | ||
128 | } > m_text | ||
129 | |||
130 | .init_array : | ||
131 | { | ||
132 | PROVIDE_HIDDEN (__init_array_start = .); | ||
133 | KEEP (*(SORT(.init_array.*))) | ||
134 | KEEP (*(.init_array*)) | ||
135 | PROVIDE_HIDDEN (__init_array_end = .); | ||
136 | } > m_text | ||
137 | |||
138 | .fini_array : | ||
139 | { | ||
140 | PROVIDE_HIDDEN (__fini_array_start = .); | ||
141 | KEEP (*(SORT(.fini_array.*))) | ||
142 | KEEP (*(.fini_array*)) | ||
143 | PROVIDE_HIDDEN (__fini_array_end = .); | ||
144 | } > m_text | ||
145 | |||
146 | __etext = .; /* define a global symbol at end of code */ | ||
147 | __DATA_ROM = .; /* Symbol is used by startup for data initialization */ | ||
148 | |||
149 | /* reserve MTB memory at the beginning of m_data */ | ||
150 | .mtb : /* MTB buffer address as defined by the hardware */ | ||
151 | { | ||
152 | . = ALIGN(8); | ||
153 | _mtb_start = .; | ||
154 | KEEP(*(.mtb_buf)) /* need to KEEP Micro Trace Buffer as not referenced by application */ | ||
155 | . = ALIGN(8); | ||
156 | _mtb_end = .; | ||
157 | } > m_data | ||
158 | |||
159 | .data : AT(__DATA_ROM) | ||
160 | { | ||
161 | . = ALIGN(4); | ||
162 | __DATA_RAM = .; | ||
163 | __data_start__ = .; /* create a global symbol at data start */ | ||
164 | *(.data) /* .data sections */ | ||
165 | *(.data*) /* .data* sections */ | ||
166 | KEEP(*(.jcr*)) | ||
167 | . = ALIGN(4); | ||
168 | __data_end__ = .; /* define a global symbol at data end */ | ||
169 | } > m_data | ||
170 | |||
171 | __DATA_END = __DATA_ROM + (__data_end__ - __data_start__); | ||
172 | text_end = ORIGIN(m_text) + LENGTH(m_text); | ||
173 | ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data") | ||
174 | |||
175 | /* Uninitialized data section */ | ||
176 | .bss : | ||
177 | { | ||
178 | /* This is used by the startup in order to initialize the .bss section */ | ||
179 | . = ALIGN(4); | ||
180 | __START_BSS = .; | ||
181 | __bss_start__ = .; | ||
182 | *(.bss) | ||
183 | *(.bss*) | ||
184 | *(COMMON) | ||
185 | . = ALIGN(4); | ||
186 | __bss_end__ = .; | ||
187 | __END_BSS = .; | ||
188 | } > m_data | ||
189 | |||
190 | .heap : | ||
191 | { | ||
192 | . = ALIGN(8); | ||
193 | __end__ = .; | ||
194 | PROVIDE(end = .); | ||
195 | __HeapBase = .; | ||
196 | . += HEAP_SIZE; | ||
197 | __HeapLimit = .; | ||
198 | __heap_limit = .; /* Add for _sbrk */ | ||
199 | } > m_data | ||
200 | |||
201 | .stack : | ||
202 | { | ||
203 | . = ALIGN(8); | ||
204 | . += STACK_SIZE; | ||
205 | } > m_data | ||
206 | |||
207 | m_usb_bdt (NOLOAD) : | ||
208 | { | ||
209 | . = ALIGN(512); | ||
210 | *(m_usb_bdt) | ||
211 | } > m_usb_sram | ||
212 | |||
213 | m_usb_global (NOLOAD) : | ||
214 | { | ||
215 | *(m_usb_global) | ||
216 | } > m_usb_sram | ||
217 | |||
218 | /* Initializes stack on the end of block */ | ||
219 | __StackTop = ORIGIN(m_data) + LENGTH(m_data); | ||
220 | __StackLimit = __StackTop - STACK_SIZE; | ||
221 | PROVIDE(__stack = __StackTop); | ||
222 | |||
223 | .ARM.attributes 0 : { *(.ARM.attributes) } | ||
224 | |||
225 | ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap") | ||
226 | } | ||
227 | |||