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
33 OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", "elf64-tradlittlemips")
37 /* Do we need any of these for elf?
39 PROVIDE (_DYNAMIC = 0);
43 /* Read-only sections, merged into text segment: */
44 . = KERNLOADADDR + SIZEOF_HEADERS;
51 /* .gnu.warning sections are handled specially by elf32.em. */
59 PROVIDE (__etext = .);
62 .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) }
63 .rodata1 : { *(.rodata1) }
64 .interp : { *(.interp) }
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) }
183 .reginfo : { *(.reginfo) }
184 .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) }
185 .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) }
186 . = ALIGN(0x2000) + (. & (0x2000 - 1));
194 .data1 : { *(.data1) }
195 .eh_frame : { KEEP (*(.eh_frame)) }
196 .gcc_except_table : { *(.gcc_except_table) }
199 /* gcc uses crtbegin.o to find the start of
200 the constructors, so we make sure it is
201 first. Because this is a wildcard, it
202 doesn't matter if the user does not
203 actually link against crtbegin.o; the
204 linker won't look for a file to match a
205 wildcard. The wildcard also means that it
206 doesn't matter which directory crtbegin.o
208 KEEP (*crtbegin.o(.ctors))
209 /* We don't want to include the .ctor section from
210 from the crtend.o file until after the sorted ctors.
211 The .ctor section from the crtend file contains the
212 end of ctors marker and it must be last */
213 KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
214 KEEP (*(SORT(.ctors.*)))
219 KEEP (*crtbegin.o(.dtors))
220 KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
221 KEEP (*(SORT(.dtors.*)))
225 _gp = ALIGN(16) + 0x7ff0;
226 .got : { *(.got.plt) *(.got) }
227 .dynamic : { *(.dynamic) }
228 /* We want the small data sections together, so single-instruction offsets
229 can access them all, and initialized data all before uninitialized, so
230 we can shorten the on-disk segment size. */
242 PROVIDE (__sbss_start = .);
243 PROVIDE (___sbss_start = .);
247 *(.gnu.linkonce.sb.*)
249 PROVIDE (__sbss_end = .);
250 PROVIDE (___sbss_end = .);
259 /* Align here to ensure that the .bss section occupies space up to
260 _end. Align after .bss to ensure correct alignment even if the
261 .bss section disappears because there are no input sections. */
267 /* Stabs debugging sections. */
268 .stab 0 : { *(.stab) }
269 .stabstr 0 : { *(.stabstr) }
270 .stab.excl 0 : { *(.stab.excl) }
271 .stab.exclstr 0 : { *(.stab.exclstr) }
272 .stab.index 0 : { *(.stab.index) }
273 .stab.indexstr 0 : { *(.stab.indexstr) }
274 .comment 0 : { *(.comment) }
275 /* DWARF debug sections.
276 Symbols in the DWARF debugging sections are relative to the beginning
277 of the section so we begin them at 0. */
279 .debug 0 : { *(.debug) }
280 .line 0 : { *(.line) }
281 /* GNU DWARF 1 extensions */
282 .debug_srcinfo 0 : { *(.debug_srcinfo) }
283 .debug_sfnames 0 : { *(.debug_sfnames) }
284 /* DWARF 1.1 and DWARF 2 */
285 .debug_aranges 0 : { *(.debug_aranges) }
286 .debug_pubnames 0 : { *(.debug_pubnames) }
288 .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
289 .debug_abbrev 0 : { *(.debug_abbrev) }
290 .debug_line 0 : { *(.debug_line) }
291 .debug_frame 0 : { *(.debug_frame) }
292 .debug_str 0 : { *(.debug_str) }
293 .debug_loc 0 : { *(.debug_loc) }
294 .debug_macinfo 0 : { *(.debug_macinfo) }
295 /* SGI/MIPS DWARF 2 extensions */
296 .debug_weaknames 0 : { *(.debug_weaknames) }
297 .debug_funcnames 0 : { *(.debug_funcnames) }
298 .debug_typenames 0 : { *(.debug_typenames) }
299 .debug_varnames 0 : { *(.debug_varnames) }
300 /* These must appear regardless of . */