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