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