1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * Derived from internal linker script of GNU ld (GNU Binutils) 2.18 for elf32ppc emulation. |
---|
5 | */ |
---|
6 | |
---|
7 | OUTPUT_FORMAT ("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") |
---|
8 | OUTPUT_ARCH (powerpc) |
---|
9 | ENTRY (start) |
---|
10 | |
---|
11 | bsp_ram_start = ORIGIN (RAM); |
---|
12 | bsp_ram_end = ORIGIN (RAM) + LENGTH (RAM); |
---|
13 | bsp_ram_size = LENGTH (RAM); |
---|
14 | |
---|
15 | bsp_rom_start = ORIGIN (ROM); |
---|
16 | bsp_rom_end = ORIGIN (ROM) + LENGTH (ROM); |
---|
17 | bsp_rom_size = LENGTH (ROM); |
---|
18 | |
---|
19 | bsp_section_align = 32; |
---|
20 | |
---|
21 | RamBase = bsp_ram_start; |
---|
22 | RamSize = bsp_ram_size; |
---|
23 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; |
---|
24 | |
---|
25 | SECTIONS { |
---|
26 | /* |
---|
27 | * BSP: MPC83XX registers |
---|
28 | */ |
---|
29 | .mpc83xx_regs (NOLOAD) : { |
---|
30 | IMMRBAR = .; |
---|
31 | mpc83xx_regs*(.text) |
---|
32 | mpc83xx_regs*(.data) |
---|
33 | mpc83xx_regs*(.bss) |
---|
34 | mpc83xx_regs*(COMMON) |
---|
35 | } > MPC83XX_REGS |
---|
36 | |
---|
37 | /* |
---|
38 | * BSP: Reset configuration |
---|
39 | */ |
---|
40 | .resconf 0x0 : { |
---|
41 | *(.resconf) |
---|
42 | } > RAM |
---|
43 | |
---|
44 | /* |
---|
45 | * BSP: Exception vectors |
---|
46 | */ |
---|
47 | .vectors 0x100 : { |
---|
48 | *(.vectors) |
---|
49 | } > RAM |
---|
50 | |
---|
51 | /* |
---|
52 | * BSP: The initial stack will live in this area - between the vectors |
---|
53 | * and the text section. |
---|
54 | */ |
---|
55 | |
---|
56 | .text 0x10000 : { |
---|
57 | /* |
---|
58 | * BSP: Start of text section |
---|
59 | */ |
---|
60 | bsp_section_text_start = .; |
---|
61 | |
---|
62 | /* |
---|
63 | * BSP: System startup entry |
---|
64 | */ |
---|
65 | KEEP (*(.entry)) |
---|
66 | |
---|
67 | /* |
---|
68 | * BSP: Moved into .text from .init |
---|
69 | */ |
---|
70 | KEEP (*(.init)) |
---|
71 | |
---|
72 | *(.text .stub .text.* .gnu.linkonce.t.*) |
---|
73 | KEEP (*(.text.*personality*)) |
---|
74 | /* .gnu.warning sections are handled specially by elf32.em. */ |
---|
75 | *(.gnu.warning) |
---|
76 | *(.glink) |
---|
77 | |
---|
78 | /* |
---|
79 | * BSP: Special FreeBSD sysctl sections |
---|
80 | */ |
---|
81 | . = ALIGN (16); |
---|
82 | __start_set_sysctl_set = .; |
---|
83 | *(set_sysctl_*); |
---|
84 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
85 | *(set_domain_*); |
---|
86 | *(set_pseudo_*); |
---|
87 | |
---|
88 | /* |
---|
89 | * BSP: Moved into .text from .* |
---|
90 | */ |
---|
91 | *(.rodata .rodata.* .gnu.linkonce.r.*) |
---|
92 | *(.rodata1) |
---|
93 | *(.interp) |
---|
94 | *(.note.gnu.build-id) |
---|
95 | *(.hash) |
---|
96 | *(.gnu.hash) |
---|
97 | *(.dynsym) |
---|
98 | *(.dynstr) |
---|
99 | *(.gnu.version) |
---|
100 | *(.gnu.version_d) |
---|
101 | *(.gnu.version_r) |
---|
102 | *(.eh_frame_hdr) |
---|
103 | |
---|
104 | /* |
---|
105 | * BSP: Magic PPC stuff |
---|
106 | */ |
---|
107 | *(.PPC.*) |
---|
108 | |
---|
109 | /* |
---|
110 | * BSP: Required by cpukit/score/src/threadhandler.c |
---|
111 | */ |
---|
112 | PROVIDE (_fini = .); |
---|
113 | |
---|
114 | /* |
---|
115 | * BSP: Moved into .text from .fini |
---|
116 | */ |
---|
117 | KEEP (*(.fini)) |
---|
118 | |
---|
119 | . = ALIGN (bsp_section_align); |
---|
120 | |
---|
121 | PROVIDE (__etext = .); |
---|
122 | PROVIDE (_etext = .); |
---|
123 | PROVIDE (etext = .); |
---|
124 | } > RAM |
---|
125 | |
---|
126 | .sdata2 : { |
---|
127 | PROVIDE (_SDA2_BASE_ = 32768); |
---|
128 | |
---|
129 | *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) |
---|
130 | |
---|
131 | . = ALIGN (bsp_section_align); |
---|
132 | } > RAM |
---|
133 | |
---|
134 | .sbss2 : { |
---|
135 | *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) |
---|
136 | |
---|
137 | . = ALIGN (bsp_section_align); |
---|
138 | |
---|
139 | /* |
---|
140 | * BSP: End and size of text section |
---|
141 | */ |
---|
142 | bsp_section_text_end = .; |
---|
143 | bsp_section_text_size = bsp_section_text_end - bsp_section_text_start; |
---|
144 | } > RAM |
---|
145 | |
---|
146 | .data : { |
---|
147 | /* |
---|
148 | * BSP: Start of data section |
---|
149 | */ |
---|
150 | bsp_section_data_start = .; |
---|
151 | |
---|
152 | /* |
---|
153 | * BSP: Moved into .data from .ctors |
---|
154 | */ |
---|
155 | /* gcc uses crtbegin.o to find the start of |
---|
156 | the constructors, so we make sure it is |
---|
157 | first. Because this is a wildcard, it |
---|
158 | doesn't matter if the user does not |
---|
159 | actually link against crtbegin.o; the |
---|
160 | linker won't look for a file to match a |
---|
161 | wildcard. The wildcard also means that it |
---|
162 | doesn't matter which directory crtbegin.o |
---|
163 | is in. */ |
---|
164 | KEEP (*crtbegin.o(.ctors)) |
---|
165 | KEEP (*crtbegin?.o(.ctors)) |
---|
166 | /* We don't want to include the .ctor section from |
---|
167 | the crtend.o file until after the sorted ctors. |
---|
168 | The .ctor section from the crtend file contains the |
---|
169 | end of ctors marker and it must be last */ |
---|
170 | KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) |
---|
171 | KEEP (*(SORT(.ctors.*))) |
---|
172 | KEEP (*(.ctors)) |
---|
173 | |
---|
174 | /* |
---|
175 | * BSP: Moved into .data from .dtors |
---|
176 | */ |
---|
177 | KEEP (*crtbegin.o(.dtors)) |
---|
178 | KEEP (*crtbegin?.o(.dtors)) |
---|
179 | KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) |
---|
180 | KEEP (*(SORT(.dtors.*))) |
---|
181 | KEEP (*(.dtors)) |
---|
182 | |
---|
183 | /* |
---|
184 | * BSP: Moved into .data from .* |
---|
185 | */ |
---|
186 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
187 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
188 | *(.data1) |
---|
189 | KEEP (*(.eh_frame)) |
---|
190 | *(.gcc_except_table .gcc_except_table.*) |
---|
191 | KEEP (*(.jcr)) |
---|
192 | *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) |
---|
193 | *(.fixup) |
---|
194 | *(.got1) |
---|
195 | *(.got2) |
---|
196 | *(.dynamic) |
---|
197 | *(.got) |
---|
198 | *(.plt) |
---|
199 | PROVIDE_HIDDEN (__preinit_array_start = .); |
---|
200 | KEEP (*(.preinit_array)) |
---|
201 | PROVIDE_HIDDEN (__preinit_array_end = .); |
---|
202 | PROVIDE_HIDDEN (__init_array_start = .); |
---|
203 | KEEP (*(SORT(.init_array.*))) |
---|
204 | KEEP (*(.init_array)) |
---|
205 | PROVIDE_HIDDEN (__init_array_end = .); |
---|
206 | PROVIDE_HIDDEN (__fini_array_start = .); |
---|
207 | KEEP (*(.fini_array)) |
---|
208 | KEEP (*(SORT(.fini_array.*))) |
---|
209 | PROVIDE_HIDDEN (__fini_array_end = .); |
---|
210 | |
---|
211 | *(.data .data.* .gnu.linkonce.d.*) |
---|
212 | KEEP (*(.gnu.linkonce.d.*personality*)) |
---|
213 | SORT(CONSTRUCTORS) |
---|
214 | |
---|
215 | . = ALIGN (bsp_section_align); |
---|
216 | } > RAM |
---|
217 | |
---|
218 | .sdata : { |
---|
219 | PROVIDE (_SDA_BASE_ = 32768); |
---|
220 | *(.sdata .sdata.* .gnu.linkonce.s.*) |
---|
221 | |
---|
222 | . = ALIGN (bsp_section_align); |
---|
223 | |
---|
224 | _edata = .; |
---|
225 | PROVIDE (edata = .); |
---|
226 | |
---|
227 | /* |
---|
228 | * BSP: End and size of data section |
---|
229 | */ |
---|
230 | bsp_section_data_end = .; |
---|
231 | bsp_section_data_size = bsp_section_data_end - bsp_section_data_start; |
---|
232 | } > RAM |
---|
233 | |
---|
234 | .sbss : { |
---|
235 | /* |
---|
236 | * BSP: Start of bss section |
---|
237 | */ |
---|
238 | bsp_section_bss_start = .; |
---|
239 | |
---|
240 | __bss_start = .; |
---|
241 | |
---|
242 | PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .); |
---|
243 | *(.scommon) |
---|
244 | *(.dynsbss) |
---|
245 | *(.sbss .sbss.* .gnu.linkonce.sb.*) |
---|
246 | PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .); |
---|
247 | |
---|
248 | . = ALIGN (bsp_section_align); |
---|
249 | } > RAM |
---|
250 | |
---|
251 | .bss : { |
---|
252 | *(COMMON) |
---|
253 | *(.dynbss) |
---|
254 | *(.bss .bss.* .gnu.linkonce.b.*) |
---|
255 | |
---|
256 | . = ALIGN (bsp_section_align); |
---|
257 | |
---|
258 | __end = .; |
---|
259 | _end = .; |
---|
260 | PROVIDE (end = .); |
---|
261 | |
---|
262 | /* |
---|
263 | * BSP: End and size of bss section |
---|
264 | */ |
---|
265 | bsp_section_bss_end = .; |
---|
266 | bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_start; |
---|
267 | } > RAM |
---|
268 | |
---|
269 | /* |
---|
270 | * BSP: Interrupt stack |
---|
271 | */ |
---|
272 | bsp_interrupt_stack_start = .; |
---|
273 | bsp_interrupt_stack_end = bsp_interrupt_stack_start + 32k; |
---|
274 | bsp_interrupt_stack_size = bsp_interrupt_stack_end - bsp_interrupt_stack_start; |
---|
275 | . = bsp_interrupt_stack_end; |
---|
276 | |
---|
277 | /* |
---|
278 | * BSP: Work area start |
---|
279 | */ |
---|
280 | bsp_work_area_start = .; |
---|
281 | WorkAreaBase = .; |
---|
282 | |
---|
283 | /* Stabs debugging sections. */ |
---|
284 | .stab 0 : { *(.stab) } |
---|
285 | .stabstr 0 : { *(.stabstr) } |
---|
286 | .stab.excl 0 : { *(.stab.excl) } |
---|
287 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
288 | .stab.index 0 : { *(.stab.index) } |
---|
289 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
290 | .comment 0 : { *(.comment) } |
---|
291 | /* DWARF debug sections. |
---|
292 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
293 | of the section so we begin them at 0. */ |
---|
294 | /* DWARF 1 */ |
---|
295 | .debug 0 : { *(.debug) } |
---|
296 | .line 0 : { *(.line) } |
---|
297 | /* GNU DWARF 1 extensions */ |
---|
298 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
299 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
300 | /* DWARF 1.1 and DWARF 2 */ |
---|
301 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
302 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
303 | /* DWARF 2 */ |
---|
304 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
---|
305 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
306 | .debug_line 0 : { *(.debug_line) } |
---|
307 | .debug_frame 0 : { *(.debug_frame) } |
---|
308 | .debug_str 0 : { *(.debug_str) } |
---|
309 | .debug_loc 0 : { *(.debug_loc) } |
---|
310 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
311 | /* SGI/MIPS DWARF 2 extensions */ |
---|
312 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
313 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
314 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
315 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
316 | /* DWARF 3 */ |
---|
317 | .debug_pubtypes 0 : { *(.debug_pubtypes) } |
---|
318 | .debug_ranges 0 : { *(.debug_ranges) } |
---|
319 | .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } |
---|
320 | |
---|
321 | /DISCARD/ : { |
---|
322 | *(.note.GNU-stack) *(.gnu_debuglink) |
---|
323 | } |
---|
324 | |
---|
325 | /* |
---|
326 | * BSP: Catch all unknown sections |
---|
327 | */ |
---|
328 | .nirvana : { |
---|
329 | *(*) |
---|
330 | } > NIRVANA |
---|
331 | } |
---|