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