2 * Copyright (c) 2001, 2004, 2008, Juniper Networks, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the Juniper Networks, Inc. nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04
34 * This linker script is needed to build a kernel for use by Broadcom CFE
35 * when loaded over TFTP; its ELF loader does not support backwards seek
36 * on network I/O streams.
37 * Furthermore, CFE will only load PT_LOAD segments, therefore the dynamic
38 * sections must be placed in their own segment.
41 OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
42 "elf32-tradlittlemips")
47 /* Do we need any of these for elf?
49 PROVIDE (_DYNAMIC = 0);
54 headers PT_PHDR FILEHDR PHDRS ;
63 /* Read-only sections, merged into text segment: */
65 .interp : { *(.interp) } :interp
66 .hash : { *(.hash) } :text
67 .dynsym : { *(.dynsym) }
68 .dynstr : { *(.dynstr) }
69 .gnu.version : { *(.gnu.version) }
70 .gnu.version_d : { *(.gnu.version_d) }
71 .gnu.version_r : { *(.gnu.version_r) }
72 .rel.init : { *(.rel.init) }
73 .rela.init : { *(.rela.init) }
78 *(.rel.gnu.linkonce.t.*)
84 *(.rela.gnu.linkonce.t.*)
86 .rel.fini : { *(.rel.fini) }
87 .rela.fini : { *(.rela.fini) }
92 *(.rel.gnu.linkonce.r.*)
98 *(.rela.gnu.linkonce.r.*)
104 *(.rel.gnu.linkonce.d.*)
110 *(.rela.gnu.linkonce.d.*)
112 .rel.ctors : { *(.rel.ctors) }
113 .rela.ctors : { *(.rela.ctors) }
114 .rel.dtors : { *(.rel.dtors) }
115 .rela.dtors : { *(.rela.dtors) }
116 .rel.got : { *(.rel.got) }
117 .rela.got : { *(.rela.got) }
122 *(.rel.gnu.linkonce.s.*)
128 *(.rela.gnu.linkonce.s.*)
134 *(.rel.gnu.linkonce.sb.*)
140 *(.rel.gnu.linkonce.sb.*)
146 *(.rel.gnu.linkonce.s2.*)
152 *(.rela.gnu.linkonce.s2.*)
158 *(.rel.gnu.linkonce.sb2.*)
164 *(.rela.gnu.linkonce.sb2.*)
170 *(.rel.gnu.linkonce.b.*)
176 *(.rela.gnu.linkonce.b.*)
178 .rel.plt : { *(.rel.plt) }
179 .rela.plt : { *(.rela.plt) }
190 /* .gnu.warning sections are handled specially by elf32.em. */
198 PROVIDE (__etext = .);
199 PROVIDE (_etext = .);
201 .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) }
202 .rodata1 : { *(.rodata1) }
203 .reginfo : { *(.reginfo) }
204 .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) }
205 .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) }
206 . = ALIGN(0x2000) + (. & (0x2000 - 1));
214 .data1 : { *(.data1) }
215 .eh_frame : { KEEP (*(.eh_frame)) }
216 .gcc_except_table : { *(.gcc_except_table) }
219 /* gcc uses crtbegin.o to find the start of
220 the constructors, so we make sure it is
221 first. Because this is a wildcard, it
222 doesn't matter if the user does not
223 actually link against crtbegin.o; the
224 linker won't look for a file to match a
225 wildcard. The wildcard also means that it
226 doesn't matter which directory crtbegin.o
228 KEEP (*crtbegin.o(.ctors))
229 /* We don't want to include the .ctor section from
230 from the crtend.o file until after the sorted ctors.
231 The .ctor section from the crtend file contains the
232 end of ctors marker and it must be last */
233 KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
234 KEEP (*(SORT(.ctors.*)))
239 KEEP (*crtbegin.o(.dtors))
240 KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
241 KEEP (*(SORT(.dtors.*)))
245 _gp = ALIGN(16) + 0x7ff0;
246 .got : { *(.got.plt) *(.got) }
247 .dynamic : { *(.dynamic) } :dynamic
248 /* We want the small data sections together, so single-instruction offsets
249 can access them all, and initialized data all before uninitialized, so
250 we can shorten the on-disk segment size. */
262 PROVIDE (__sbss_start = .);
263 PROVIDE (___sbss_start = .);
267 *(.gnu.linkonce.sb.*)
269 PROVIDE (__sbss_end = .);
270 PROVIDE (___sbss_end = .);
279 /* Align here to ensure that the .bss section occupies space up to
280 _end. Align after .bss to ensure correct alignment even if the
281 .bss section disappears because there are no input sections. */
287 /* Stabs debugging sections. */
288 .stab 0 : { *(.stab) }
289 .stabstr 0 : { *(.stabstr) }
290 .stab.excl 0 : { *(.stab.excl) }
291 .stab.exclstr 0 : { *(.stab.exclstr) }
292 .stab.index 0 : { *(.stab.index) }
293 .stab.indexstr 0 : { *(.stab.indexstr) }
294 .comment 0 : { *(.comment) }
295 /* DWARF debug sections.
296 Symbols in the DWARF debugging sections are relative to the beginning
297 of the section so we begin them at 0. */
299 .debug 0 : { *(.debug) }
300 .line 0 : { *(.line) }
301 /* GNU DWARF 1 extensions */
302 .debug_srcinfo 0 : { *(.debug_srcinfo) }
303 .debug_sfnames 0 : { *(.debug_sfnames) }
304 /* DWARF 1.1 and DWARF 2 */
305 .debug_aranges 0 : { *(.debug_aranges) }
306 .debug_pubnames 0 : { *(.debug_pubnames) }
308 .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
309 .debug_abbrev 0 : { *(.debug_abbrev) }
310 .debug_line 0 : { *(.debug_line) }
311 .debug_frame 0 : { *(.debug_frame) }
312 .debug_str 0 : { *(.debug_str) }
313 .debug_loc 0 : { *(.debug_loc) }
314 .debug_macinfo 0 : { *(.debug_macinfo) }
315 /* SGI/MIPS DWARF 2 extensions */
316 .debug_weaknames 0 : { *(.debug_weaknames) }
317 .debug_funcnames 0 : { *(.debug_funcnames) }
318 .debug_typenames 0 : { *(.debug_typenames) }
319 .debug_varnames 0 : { *(.debug_varnames) }
320 /* These must appear regardless of . */