diff options
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/devices/LPC54113/gcc/LPC54113J128_ram.ld')
-rw-r--r-- | lib/chibios-contrib/ext/mcux-sdk/devices/LPC54113/gcc/LPC54113J128_ram.ld | 199 |
1 files changed, 199 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54113/gcc/LPC54113J128_ram.ld b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54113/gcc/LPC54113J128_ram.ld new file mode 100644 index 000000000..633a3ac8a --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54113/gcc/LPC54113J128_ram.ld | |||
@@ -0,0 +1,199 @@ | |||
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 */ | ||
25 | ENTRY(Reset_Handler) | ||
26 | |||
27 | HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400; | ||
28 | STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0800; | ||
29 | RPMSG_SHMEM_SIZE = DEFINED(__use_shmem__) ? 0x1800 : 0; | ||
30 | |||
31 | |||
32 | /* Specify the memory areas */ | ||
33 | MEMORY | ||
34 | { | ||
35 | m_interrupts (RX) : ORIGIN = 0x20000000, LENGTH = 0x000000E0 | ||
36 | m_text (RX) : ORIGIN = 0x200000E0, LENGTH = 0x0001FF20 | ||
37 | m_data (RW) : ORIGIN = 0x20020000, LENGTH = 0x00008000 | ||
38 | } | ||
39 | |||
40 | /* Define output sections */ | ||
41 | SECTIONS | ||
42 | { | ||
43 | |||
44 | /* The startup code goes first into internal flash */ | ||
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 flash */ | ||
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 | .data : AT(__DATA_ROM) | ||
142 | { | ||
143 | . = ALIGN(4); | ||
144 | __DATA_RAM = .; | ||
145 | __data_start__ = .; /* create a global symbol at data start */ | ||
146 | *(.ramfunc*) /* for functions in ram */ | ||
147 | *(.data) /* .data sections */ | ||
148 | *(.data*) /* .data* sections */ | ||
149 | KEEP(*(.jcr*)) | ||
150 | . = ALIGN(4); | ||
151 | __data_end__ = .; /* define a global symbol at data end */ | ||
152 | } > m_data | ||
153 | |||
154 | __DATA_END = __DATA_ROM + (__data_end__ - __data_start__); | ||
155 | text_end = ORIGIN(m_text) + LENGTH(m_text); | ||
156 | ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data") | ||
157 | |||
158 | /* Uninitialized data section */ | ||
159 | .bss : | ||
160 | { | ||
161 | /* This is used by the startup in order to initialize the .bss section */ | ||
162 | . = ALIGN(4); | ||
163 | __START_BSS = .; | ||
164 | __bss_start__ = .; | ||
165 | *(.bss) | ||
166 | *(.bss*) | ||
167 | *(COMMON) | ||
168 | . = ALIGN(4); | ||
169 | __bss_end__ = .; | ||
170 | __END_BSS = .; | ||
171 | } > m_data | ||
172 | |||
173 | .heap : | ||
174 | { | ||
175 | . = ALIGN(8); | ||
176 | __end__ = .; | ||
177 | PROVIDE(end = .); | ||
178 | __HeapBase = .; | ||
179 | . += HEAP_SIZE; | ||
180 | __HeapLimit = .; | ||
181 | __heap_limit = .; /* Add for _sbrk */ | ||
182 | } > m_data | ||
183 | |||
184 | .stack : | ||
185 | { | ||
186 | . = ALIGN(8); | ||
187 | . += STACK_SIZE; | ||
188 | } > m_data | ||
189 | |||
190 | /* Initializes stack on the end of block */ | ||
191 | __StackTop = ORIGIN(m_data) + LENGTH(m_data); | ||
192 | __StackLimit = __StackTop - STACK_SIZE; | ||
193 | PROVIDE(__stack = __StackTop); | ||
194 | |||
195 | .ARM.attributes 0 : { *(.ARM.attributes) } | ||
196 | |||
197 | ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap") | ||
198 | } | ||
199 | |||