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