1/*-
2 * Copyright (c) 2001, 2004, 2008, Juniper Networks, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
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.
16 *
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
27 * SUCH DAMAGE.
28 *
29 *	JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04
30 * $FreeBSD$
31 */
32
33OUTPUT_ARCH(mips)
34ENTRY(_start)
35SEARCH_DIR(/usr/lib);
36
37SECTIONS
38{
39  /* Read-only sections, merged into text segment: */
40  . = KERNLOADADDR + SIZEOF_HEADERS;
41  .interp     : { *(.interp) 	}
42  .hash          : { *(.hash)		}
43  .dynsym        : { *(.dynsym)		}
44  .dynstr        : { *(.dynstr)		}
45  .gnu.version   : { *(.gnu.version)	}
46  .gnu.version_d   : { *(.gnu.version_d)	}
47  .gnu.version_r   : { *(.gnu.version_r)	}
48  .rel.init      : { *(.rel.init)	}
49  .rela.init     : { *(.rela.init)	}
50  .rel.text      :
51    {
52      *(.rel.text)
53      *(.rel.text.*)
54      *(.rel.gnu.linkonce.t.*)
55    }
56  .rela.text     :
57    {
58      *(.rela.text)
59      *(.rela.text.*)
60      *(.rela.gnu.linkonce.t.*)
61    }
62  .rel.fini      : { *(.rel.fini)	}
63  .rela.fini     : { *(.rela.fini)	}
64  .rel.rodata    :
65    {
66      *(.rel.rodata)
67      *(.rel.rodata.*)
68      *(.rel.gnu.linkonce.r.*)
69    }
70  .rela.rodata   :
71    {
72      *(.rela.rodata)
73      *(.rela.rodata.*)
74      *(.rela.gnu.linkonce.r.*)
75    }
76  .rel.data      :
77    {
78      *(.rel.data)
79      *(.rel.data.*)
80      *(.rel.gnu.linkonce.d.*)
81    }
82  .rela.data     :
83    {
84      *(.rela.data)
85      *(.rela.data.*)
86      *(.rela.gnu.linkonce.d.*)
87    }
88  .rel.ctors     : { *(.rel.ctors)	}
89  .rela.ctors    : { *(.rela.ctors)	}
90  .rel.dtors     : { *(.rel.dtors)	}
91  .rela.dtors    : { *(.rela.dtors)	}
92  .rel.got       : { *(.rel.got)		}
93  .rela.got      : { *(.rela.got)		}
94  .rel.sdata     :
95    {
96      *(.rel.sdata)
97      *(.rel.sdata.*)
98      *(.rel.gnu.linkonce.s.*)
99    }
100  .rela.sdata     :
101    {
102      *(.rela.sdata)
103      *(.rela.sdata.*)
104      *(.rela.gnu.linkonce.s.*)
105    }
106  .rel.sbss      :
107    { 
108      *(.rel.sbss)
109      *(.rel.sbss.*)
110      *(.rel.gnu.linkonce.sb.*)
111    }
112  .rela.sbss     :
113    {
114      *(.rela.sbss)
115      *(.rela.sbss.*)
116      *(.rel.gnu.linkonce.sb.*)
117    }
118  .rel.sdata2    : 
119    { 
120      *(.rel.sdata2)
121      *(.rel.sdata2.*)
122      *(.rel.gnu.linkonce.s2.*)
123    }
124  .rela.sdata2   : 
125    {
126      *(.rela.sdata2)
127      *(.rela.sdata2.*)
128      *(.rela.gnu.linkonce.s2.*)
129    }
130  .rel.sbss2     : 
131    { 
132      *(.rel.sbss2)	
133      *(.rel.sbss2.*)
134      *(.rel.gnu.linkonce.sb2.*)
135    }
136  .rela.sbss2    : 
137    { 
138      *(.rela.sbss2)	
139      *(.rela.sbss2.*)
140      *(.rela.gnu.linkonce.sb2.*)
141    }
142  .rel.bss       : 
143    { 
144      *(.rel.bss)
145      *(.rel.bss.*)
146      *(.rel.gnu.linkonce.b.*)
147    }
148  .rela.bss      : 
149    { 
150      *(.rela.bss)
151      *(.rela.bss.*)
152      *(.rela.gnu.linkonce.b.*)
153    }
154  .rel.plt       : { *(.rel.plt)		}
155  .rela.plt      : { *(.rela.plt)		}
156  .init          : 
157  { 
158    KEEP (*(.init))
159  } =0x1000000
160  .text      :
161  {
162    *(.trap)
163    *(.text)
164    *(.text.*)
165    *(.stub)
166    /* .gnu.warning sections are handled specially by elf64.em.  */
167    *(.gnu.warning)
168    *(.gnu.linkonce.t.*)
169  } =0x1000000
170  .fini      :
171  {
172    KEEP (*(.fini))
173  } =0x1000000
174  PROVIDE (__etext = .);
175  PROVIDE (_etext = .);
176  PROVIDE (etext = .);
177  .rodata   : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) }
178  .rodata1   : { *(.rodata1) }
179  .reginfo : { *(.reginfo) }
180  .sdata2   : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) }
181  .sbss2   : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) }
182  . = ALIGN(0x2000) + (. & (0x2000 - 1));
183  .data    :
184  {
185    *(.data)
186    *(.data.*)
187    *(.gnu.linkonce.d.*)
188    SORT(CONSTRUCTORS)
189  }
190  .data1   : { *(.data1) }
191  .eh_frame : { KEEP (*(.eh_frame)) }
192  .gcc_except_table : { *(.gcc_except_table) }
193  .ctors   : 
194  {
195    /* gcc uses crtbegin.o to find the start of
196       the constructors, so we make sure it is
197       first.  Because this is a wildcard, it
198       doesn't matter if the user does not
199       actually link against crtbegin.o; the
200       linker won't look for a file to match a
201       wildcard.  The wildcard also means that it
202       doesn't matter which directory crtbegin.o
203       is in.  */
204    KEEP (*crtbegin.o(.ctors))
205    /* We don't want to include the .ctor section from
206       from the crtend.o file until after the sorted ctors.
207       The .ctor section from the crtend file contains the
208       end of ctors marker and it must be last */
209    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
210    KEEP (*(SORT(.ctors.*)))
211    KEEP (*(.ctors))
212  }
213   .dtors         :
214  {
215    KEEP (*crtbegin.o(.dtors))
216    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
217    KEEP (*(SORT(.dtors.*)))
218    KEEP (*(.dtors))
219  }
220  .plt      : { *(.plt)	}
221  _gp = ALIGN(16) + 0x7ff0;
222  .got		  : { *(.got.plt) *(.got) }
223  .dynamic       : { *(.dynamic) }
224  /* We want the small data sections together, so single-instruction offsets
225     can access them all, and initialized data all before uninitialized, so
226     we can shorten the on-disk segment size.  */
227  .sdata     : 
228  {
229    *(.sdata) 
230    *(.sdata.*)
231    *(.gnu.linkonce.s.*)
232  }
233  _edata = .;
234  PROVIDE (edata = .);
235  __bss_start = .;
236  .sbss      :
237  {
238    PROVIDE (__sbss_start = .);
239    PROVIDE (___sbss_start = .);
240    *(.dynsbss)
241    *(.sbss)
242    *(.sbss.*)
243    *(.gnu.linkonce.sb.*)
244    *(.scommon)
245    PROVIDE (__sbss_end = .);
246    PROVIDE (___sbss_end = .);
247  }
248  .bss       :
249  {
250   *(.dynbss)
251   *(.bss)
252   *(.bss.*)
253   *(.gnu.linkonce.b.*)
254   *(COMMON)
255   /* Align here to ensure that the .bss section occupies space up to
256      _end.  Align after .bss to ensure correct alignment even if the
257      .bss section disappears because there are no input sections.  */
258   . = ALIGN(64 / 8);
259  }
260  . = ALIGN(64 / 8);
261  _end = .;
262  PROVIDE (end = .);
263  /* Stabs debugging sections.  */
264  .stab 0 : { *(.stab) }
265  .stabstr 0 : { *(.stabstr) }
266  .stab.excl 0 : { *(.stab.excl) }
267  .stab.exclstr 0 : { *(.stab.exclstr) }
268  .stab.index 0 : { *(.stab.index) }
269  .stab.indexstr 0 : { *(.stab.indexstr) }
270  .comment 0 : { *(.comment) }
271  /* DWARF debug sections.
272     Symbols in the DWARF debugging sections are relative to the beginning
273     of the section so we begin them at 0.  */
274  /* DWARF 1 */
275  .debug          0 : { *(.debug) }
276  .line           0 : { *(.line) }
277  /* GNU DWARF 1 extensions */
278  .debug_srcinfo  0 : { *(.debug_srcinfo) }
279  .debug_sfnames  0 : { *(.debug_sfnames) }
280  /* DWARF 1.1 and DWARF 2 */
281  .debug_aranges  0 : { *(.debug_aranges) }
282  .debug_pubnames 0 : { *(.debug_pubnames) }
283  /* DWARF 2 */
284  .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
285  .debug_abbrev   0 : { *(.debug_abbrev) }
286  .debug_line     0 : { *(.debug_line) }
287  .debug_frame    0 : { *(.debug_frame) }
288  .debug_str      0 : { *(.debug_str) }
289  .debug_loc      0 : { *(.debug_loc) }
290  .debug_macinfo  0 : { *(.debug_macinfo) }
291  /* SGI/MIPS DWARF 2 extensions */
292  .debug_weaknames 0 : { *(.debug_weaknames) }
293  .debug_funcnames 0 : { *(.debug_funcnames) }
294  .debug_typenames 0 : { *(.debug_typenames) }
295  .debug_varnames  0 : { *(.debug_varnames) }
296  /* These must appear regardless of  .  */
297}
298