1183170Simp/*-
2183170Simp * Copyright (c) 2001, 2004, 2008, Juniper Networks, Inc.
3183170Simp * All rights reserved.
4183170Simp *
5183170Simp * Redistribution and use in source and binary forms, with or without
6183170Simp * modification, are permitted provided that the following conditions
7183170Simp * are met:
8183170Simp * 1. Redistributions of source code must retain the above copyright
9183170Simp *    notice, this list of conditions and the following disclaimer.
10183170Simp * 2. Redistributions in binary form must reproduce the above copyright
11183170Simp *    notice, this list of conditions and the following disclaimer in the
12183170Simp *    documentation and/or other materials provided with the distribution.
13183170Simp * 3. Neither the name of the Juniper Networks, Inc. nor the names of its
14183170Simp *    contributors may be used to endorse or promote products derived from
15183170Simp *    this software without specific prior written permission.
16183170Simp *
17183170Simp * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS AND CONTRIBUTORS ``AS IS'' AND
18183170Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19183170Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20183170Simp * ARE DISCLAIMED. IN NO EVENT SHALL JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE
21183170Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22183170Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23183170Simp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24183170Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25183170Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26183170Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27183170Simp * SUCH DAMAGE.
28183170Simp *
29183170Simp *	JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04
30183170Simp * $FreeBSD$
31183170Simp */
32183170Simp
33178170SimpOUTPUT_ARCH(mips)
34178170SimpENTRY(_start)
35178170SimpSEARCH_DIR(/usr/lib);
36178170SimpSECTIONS
37178170Simp{
38178170Simp  /* Read-only sections, merged into text segment: */
39201985Simp  . = KERNLOADADDR + SIZEOF_HEADERS;
40202865Sgonzo  .text      :
41202865Sgonzo  {
42202865Sgonzo    *(.trap)
43202865Sgonzo    *(.text)
44202865Sgonzo    *(.text.*)
45202865Sgonzo    *(.stub)
46202865Sgonzo    /* .gnu.warning sections are handled specially by elf32.em.  */
47202865Sgonzo    *(.gnu.warning)
48202865Sgonzo    *(.gnu.linkonce.t.*)
49202865Sgonzo  } =0x1000000
50202865Sgonzo  .fini      :
51202865Sgonzo  {
52202865Sgonzo    KEEP (*(.fini))
53202865Sgonzo  } =0x1000000
54202865Sgonzo  PROVIDE (__etext = .);
55202865Sgonzo  PROVIDE (_etext = .);
56202865Sgonzo  PROVIDE (etext = .);
57202865Sgonzo  .rodata   : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) }
58202865Sgonzo  .rodata1   : { *(.rodata1) }
59178170Simp  .interp     : { *(.interp) 	}
60178170Simp  .hash          : { *(.hash)		}
61178170Simp  .dynsym        : { *(.dynsym)		}
62178170Simp  .dynstr        : { *(.dynstr)		}
63178170Simp  .gnu.version   : { *(.gnu.version)	}
64178170Simp  .gnu.version_d   : { *(.gnu.version_d)	}
65178170Simp  .gnu.version_r   : { *(.gnu.version_r)	}
66178170Simp  .rel.init      : { *(.rel.init)	}
67178170Simp  .rela.init     : { *(.rela.init)	}
68178170Simp  .rel.text      :
69178170Simp    {
70178170Simp      *(.rel.text)
71178170Simp      *(.rel.text.*)
72178170Simp      *(.rel.gnu.linkonce.t.*)
73178170Simp    }
74178170Simp  .rela.text     :
75178170Simp    {
76178170Simp      *(.rela.text)
77178170Simp      *(.rela.text.*)
78178170Simp      *(.rela.gnu.linkonce.t.*)
79178170Simp    }
80178170Simp  .rel.fini      : { *(.rel.fini)	}
81178170Simp  .rela.fini     : { *(.rela.fini)	}
82178170Simp  .rel.rodata    :
83178170Simp    {
84178170Simp      *(.rel.rodata)
85178170Simp      *(.rel.rodata.*)
86178170Simp      *(.rel.gnu.linkonce.r.*)
87178170Simp    }
88178170Simp  .rela.rodata   :
89178170Simp    {
90178170Simp      *(.rela.rodata)
91178170Simp      *(.rela.rodata.*)
92178170Simp      *(.rela.gnu.linkonce.r.*)
93178170Simp    }
94178170Simp  .rel.data      :
95178170Simp    {
96178170Simp      *(.rel.data)
97178170Simp      *(.rel.data.*)
98178170Simp      *(.rel.gnu.linkonce.d.*)
99178170Simp    }
100178170Simp  .rela.data     :
101178170Simp    {
102178170Simp      *(.rela.data)
103178170Simp      *(.rela.data.*)
104178170Simp      *(.rela.gnu.linkonce.d.*)
105178170Simp    }
106178170Simp  .rel.ctors     : { *(.rel.ctors)	}
107178170Simp  .rela.ctors    : { *(.rela.ctors)	}
108178170Simp  .rel.dtors     : { *(.rel.dtors)	}
109178170Simp  .rela.dtors    : { *(.rela.dtors)	}
110178170Simp  .rel.got       : { *(.rel.got)		}
111178170Simp  .rela.got      : { *(.rela.got)		}
112178170Simp  .rel.sdata     :
113178170Simp    {
114178170Simp      *(.rel.sdata)
115178170Simp      *(.rel.sdata.*)
116178170Simp      *(.rel.gnu.linkonce.s.*)
117178170Simp    }
118178170Simp  .rela.sdata     :
119178170Simp    {
120178170Simp      *(.rela.sdata)
121178170Simp      *(.rela.sdata.*)
122178170Simp      *(.rela.gnu.linkonce.s.*)
123178170Simp    }
124178170Simp  .rel.sbss      :
125178170Simp    { 
126178170Simp      *(.rel.sbss)
127178170Simp      *(.rel.sbss.*)
128178170Simp      *(.rel.gnu.linkonce.sb.*)
129178170Simp    }
130178170Simp  .rela.sbss     :
131178170Simp    {
132178170Simp      *(.rela.sbss)
133178170Simp      *(.rela.sbss.*)
134178170Simp      *(.rel.gnu.linkonce.sb.*)
135178170Simp    }
136178170Simp  .rel.sdata2    : 
137178170Simp    { 
138178170Simp      *(.rel.sdata2)
139178170Simp      *(.rel.sdata2.*)
140178170Simp      *(.rel.gnu.linkonce.s2.*)
141178170Simp    }
142178170Simp  .rela.sdata2   : 
143178170Simp    {
144178170Simp      *(.rela.sdata2)
145178170Simp      *(.rela.sdata2.*)
146178170Simp      *(.rela.gnu.linkonce.s2.*)
147178170Simp    }
148178170Simp  .rel.sbss2     : 
149178170Simp    { 
150178170Simp      *(.rel.sbss2)	
151178170Simp      *(.rel.sbss2.*)
152178170Simp      *(.rel.gnu.linkonce.sb2.*)
153178170Simp    }
154178170Simp  .rela.sbss2    : 
155178170Simp    { 
156178170Simp      *(.rela.sbss2)	
157178170Simp      *(.rela.sbss2.*)
158178170Simp      *(.rela.gnu.linkonce.sb2.*)
159178170Simp    }
160178170Simp  .rel.bss       : 
161178170Simp    { 
162178170Simp      *(.rel.bss)
163178170Simp      *(.rel.bss.*)
164178170Simp      *(.rel.gnu.linkonce.b.*)
165178170Simp    }
166178170Simp  .rela.bss      : 
167178170Simp    { 
168178170Simp      *(.rela.bss)
169178170Simp      *(.rela.bss.*)
170178170Simp      *(.rela.gnu.linkonce.b.*)
171178170Simp    }
172178170Simp  .rel.plt       : { *(.rel.plt)		}
173178170Simp  .rela.plt      : { *(.rela.plt)		}
174178170Simp  .init          : 
175178170Simp  { 
176178170Simp    KEEP (*(.init))
177178170Simp  } =0x1000000
178178170Simp  .reginfo : { *(.reginfo) }
179178170Simp  .sdata2   : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) }
180178170Simp  .sbss2   : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) }
181178170Simp  . = ALIGN(0x2000) + (. & (0x2000 - 1));
182178170Simp  .data    :
183178170Simp  {
184178170Simp    *(.data)
185178170Simp    *(.data.*)
186178170Simp    *(.gnu.linkonce.d.*)
187178170Simp    SORT(CONSTRUCTORS)
188178170Simp  }
189178170Simp  .data1   : { *(.data1) }
190178170Simp  .eh_frame : { KEEP (*(.eh_frame)) }
191178170Simp  .gcc_except_table : { *(.gcc_except_table) }
192178170Simp  .ctors   : 
193178170Simp  {
194178170Simp    /* gcc uses crtbegin.o to find the start of
195178170Simp       the constructors, so we make sure it is
196178170Simp       first.  Because this is a wildcard, it
197178170Simp       doesn't matter if the user does not
198178170Simp       actually link against crtbegin.o; the
199178170Simp       linker won't look for a file to match a
200178170Simp       wildcard.  The wildcard also means that it
201178170Simp       doesn't matter which directory crtbegin.o
202178170Simp       is in.  */
203178170Simp    KEEP (*crtbegin.o(.ctors))
204178170Simp    /* We don't want to include the .ctor section from
205178170Simp       from the crtend.o file until after the sorted ctors.
206178170Simp       The .ctor section from the crtend file contains the
207178170Simp       end of ctors marker and it must be last */
208178170Simp    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
209178170Simp    KEEP (*(SORT(.ctors.*)))
210178170Simp    KEEP (*(.ctors))
211178170Simp  }
212178170Simp   .dtors         :
213178170Simp  {
214178170Simp    KEEP (*crtbegin.o(.dtors))
215178170Simp    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
216178170Simp    KEEP (*(SORT(.dtors.*)))
217178170Simp    KEEP (*(.dtors))
218178170Simp  }
219178170Simp  .plt      : { *(.plt)	}
220178170Simp  _gp = ALIGN(16) + 0x7ff0;
221178170Simp  .got		  : { *(.got.plt) *(.got) }
222178170Simp  .dynamic       : { *(.dynamic) }
223178170Simp  /* We want the small data sections together, so single-instruction offsets
224178170Simp     can access them all, and initialized data all before uninitialized, so
225178170Simp     we can shorten the on-disk segment size.  */
226178170Simp  .sdata     : 
227178170Simp  {
228178170Simp    *(.sdata) 
229178170Simp    *(.sdata.*)
230178170Simp    *(.gnu.linkonce.s.*)
231178170Simp  }
232178170Simp  _edata = .;
233178170Simp  PROVIDE (edata = .);
234178170Simp  __bss_start = .;
235178170Simp  .sbss      :
236178170Simp  {
237178170Simp    PROVIDE (__sbss_start = .);
238178170Simp    PROVIDE (___sbss_start = .);
239178170Simp    *(.dynsbss)
240178170Simp    *(.sbss)
241178170Simp    *(.sbss.*)
242178170Simp    *(.gnu.linkonce.sb.*)
243178170Simp    *(.scommon)
244178170Simp    PROVIDE (__sbss_end = .);
245178170Simp    PROVIDE (___sbss_end = .);
246178170Simp  }
247178170Simp  .bss       :
248178170Simp  {
249178170Simp   *(.dynbss)
250178170Simp   *(.bss)
251178170Simp   *(.bss.*)
252178170Simp   *(.gnu.linkonce.b.*)
253178170Simp   *(COMMON)
254178170Simp   /* Align here to ensure that the .bss section occupies space up to
255178170Simp      _end.  Align after .bss to ensure correct alignment even if the
256178170Simp      .bss section disappears because there are no input sections.  */
257178170Simp   . = ALIGN(64 / 8);
258178170Simp  }
259178170Simp  . = ALIGN(64 / 8);
260178170Simp  _end = .;
261178170Simp  PROVIDE (end = .);
262178170Simp  /* Stabs debugging sections.  */
263178170Simp  .stab 0 : { *(.stab) }
264178170Simp  .stabstr 0 : { *(.stabstr) }
265178170Simp  .stab.excl 0 : { *(.stab.excl) }
266178170Simp  .stab.exclstr 0 : { *(.stab.exclstr) }
267178170Simp  .stab.index 0 : { *(.stab.index) }
268178170Simp  .stab.indexstr 0 : { *(.stab.indexstr) }
269178170Simp  .comment 0 : { *(.comment) }
270178170Simp  /* DWARF debug sections.
271178170Simp     Symbols in the DWARF debugging sections are relative to the beginning
272178170Simp     of the section so we begin them at 0.  */
273178170Simp  /* DWARF 1 */
274178170Simp  .debug          0 : { *(.debug) }
275178170Simp  .line           0 : { *(.line) }
276178170Simp  /* GNU DWARF 1 extensions */
277178170Simp  .debug_srcinfo  0 : { *(.debug_srcinfo) }
278178170Simp  .debug_sfnames  0 : { *(.debug_sfnames) }
279178170Simp  /* DWARF 1.1 and DWARF 2 */
280178170Simp  .debug_aranges  0 : { *(.debug_aranges) }
281178170Simp  .debug_pubnames 0 : { *(.debug_pubnames) }
282178170Simp  /* DWARF 2 */
283178170Simp  .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
284178170Simp  .debug_abbrev   0 : { *(.debug_abbrev) }
285178170Simp  .debug_line     0 : { *(.debug_line) }
286178170Simp  .debug_frame    0 : { *(.debug_frame) }
287178170Simp  .debug_str      0 : { *(.debug_str) }
288178170Simp  .debug_loc      0 : { *(.debug_loc) }
289178170Simp  .debug_macinfo  0 : { *(.debug_macinfo) }
290178170Simp  /* SGI/MIPS DWARF 2 extensions */
291178170Simp  .debug_weaknames 0 : { *(.debug_weaknames) }
292178170Simp  .debug_funcnames 0 : { *(.debug_funcnames) }
293178170Simp  .debug_typenames 0 : { *(.debug_typenames) }
294178170Simp  .debug_varnames  0 : { *(.debug_varnames) }
295178170Simp  /* These must appear regardless of  .  */
296178170Simp}
297