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("elf64-tradbigmips", "elf64-tradbigmips", "elf64-tradlittlemips")
46 /* Do we need any of these for elf?
48 PROVIDE (_DYNAMIC = 0);
53 headers PT_PHDR FILEHDR PHDRS ;
62 /* Read-only sections, merged into text segment: */
64 .interp : { *(.interp) } :interp
65 .hash : { *(.hash) } :text
66 .dynsym : { *(.dynsym) }
67 .dynstr : { *(.dynstr) }
68 .gnu.version : { *(.gnu.version) }
69 .gnu.version_d : { *(.gnu.version_d) }
70 .gnu.version_r : { *(.gnu.version_r) }
71 .rel.init : { *(.rel.init) }
72 .rela.init : { *(.rela.init) }
77 *(.rel.gnu.linkonce.t.*)
83 *(.rela.gnu.linkonce.t.*)
85 .rel.fini : { *(.rel.fini) }
86 .rela.fini : { *(.rela.fini) }
91 *(.rel.gnu.linkonce.r.*)
97 *(.rela.gnu.linkonce.r.*)
103 *(.rel.gnu.linkonce.d.*)
109 *(.rela.gnu.linkonce.d.*)
111 .rel.ctors : { *(.rel.ctors) }
112 .rela.ctors : { *(.rela.ctors) }
113 .rel.dtors : { *(.rel.dtors) }
114 .rela.dtors : { *(.rela.dtors) }
115 .rel.got : { *(.rel.got) }
116 .rela.got : { *(.rela.got) }
121 *(.rel.gnu.linkonce.s.*)
127 *(.rela.gnu.linkonce.s.*)
133 *(.rel.gnu.linkonce.sb.*)
139 *(.rel.gnu.linkonce.sb.*)
145 *(.rel.gnu.linkonce.s2.*)
151 *(.rela.gnu.linkonce.s2.*)
157 *(.rel.gnu.linkonce.sb2.*)
163 *(.rela.gnu.linkonce.sb2.*)
169 *(.rel.gnu.linkonce.b.*)
175 *(.rela.gnu.linkonce.b.*)
177 .rel.plt : { *(.rel.plt) }
178 .rela.plt : { *(.rela.plt) }
189 /* .gnu.warning sections are handled specially by elf32.em. */
197 PROVIDE (__etext = .);
198 PROVIDE (_etext = .);
200 .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) }
201 .rodata1 : { *(.rodata1) }
202 .reginfo : { *(.reginfo) }
203 .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) }
204 .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) }
205 . = ALIGN(0x2000) + (. & (0x2000 - 1));
213 .data1 : { *(.data1) }
214 .eh_frame : { KEEP (*(.eh_frame)) }
215 .gcc_except_table : { *(.gcc_except_table) }
218 /* gcc uses crtbegin.o to find the start of
219 the constructors, so we make sure it is
220 first. Because this is a wildcard, it
221 doesn't matter if the user does not
222 actually link against crtbegin.o; the
223 linker won't look for a file to match a
224 wildcard. The wildcard also means that it
225 doesn't matter which directory crtbegin.o
227 KEEP (*crtbegin.o(.ctors))
228 /* We don't want to include the .ctor section from
229 from the crtend.o file until after the sorted ctors.
230 The .ctor section from the crtend file contains the
231 end of ctors marker and it must be last */
232 KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
233 KEEP (*(SORT(.ctors.*)))
238 KEEP (*crtbegin.o(.dtors))
239 KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
240 KEEP (*(SORT(.dtors.*)))
244 _gp = ALIGN(16) + 0x7ff0;
245 .got : { *(.got.plt) *(.got) }
246 .dynamic : { *(.dynamic) } :dynamic
247 /* We want the small data sections together, so single-instruction offsets
248 can access them all, and initialized data all before uninitialized, so
249 we can shorten the on-disk segment size. */
261 PROVIDE (__sbss_start = .);
262 PROVIDE (___sbss_start = .);
266 *(.gnu.linkonce.sb.*)
268 PROVIDE (__sbss_end = .);
269 PROVIDE (___sbss_end = .);
278 /* Align here to ensure that the .bss section occupies space up to
279 _end. Align after .bss to ensure correct alignment even if the
280 .bss section disappears because there are no input sections. */
286 /* Stabs debugging sections. */
287 .stab 0 : { *(.stab) }
288 .stabstr 0 : { *(.stabstr) }
289 .stab.excl 0 : { *(.stab.excl) }
290 .stab.exclstr 0 : { *(.stab.exclstr) }
291 .stab.index 0 : { *(.stab.index) }
292 .stab.indexstr 0 : { *(.stab.indexstr) }
293 .comment 0 : { *(.comment) }
294 /* DWARF debug sections.
295 Symbols in the DWARF debugging sections are relative to the beginning
296 of the section so we begin them at 0. */
298 .debug 0 : { *(.debug) }
299 .line 0 : { *(.line) }
300 /* GNU DWARF 1 extensions */
301 .debug_srcinfo 0 : { *(.debug_srcinfo) }
302 .debug_sfnames 0 : { *(.debug_sfnames) }
303 /* DWARF 1.1 and DWARF 2 */
304 .debug_aranges 0 : { *(.debug_aranges) }
305 .debug_pubnames 0 : { *(.debug_pubnames) }
307 .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
308 .debug_abbrev 0 : { *(.debug_abbrev) }
309 .debug_line 0 : { *(.debug_line) }
310 .debug_frame 0 : { *(.debug_frame) }
311 .debug_str 0 : { *(.debug_str) }
312 .debug_loc 0 : { *(.debug_loc) }
313 .debug_macinfo 0 : { *(.debug_macinfo) }
314 /* SGI/MIPS DWARF 2 extensions */
315 .debug_weaknames 0 : { *(.debug_weaknames) }
316 .debug_funcnames 0 : { *(.debug_funcnames) }
317 .debug_typenames 0 : { *(.debug_typenames) }
318 .debug_varnames 0 : { *(.debug_varnames) }
319 /* These must appear regardless of . */