1196239Simp/*-
2196239Simp * Copyright (c) 2001, 2004, 2008, Juniper Networks, Inc.
3196239Simp * All rights reserved.
4196239Simp *
5196239Simp * Redistribution and use in source and binary forms, with or without
6196239Simp * modification, are permitted provided that the following conditions
7196239Simp * are met:
8196239Simp * 1. Redistributions of source code must retain the above copyright
9196239Simp *    notice, this list of conditions and the following disclaimer.
10196239Simp * 2. Redistributions in binary form must reproduce the above copyright
11196239Simp *    notice, this list of conditions and the following disclaimer in the
12196239Simp *    documentation and/or other materials provided with the distribution.
13196239Simp * 3. Neither the name of the Juniper Networks, Inc. nor the names of its
14196239Simp *    contributors may be used to endorse or promote products derived from
15196239Simp *    this software without specific prior written permission.
16196239Simp *
17196239Simp * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS AND CONTRIBUTORS ``AS IS'' AND
18196239Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19196239Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20196239Simp * ARE DISCLAIMED. IN NO EVENT SHALL JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE
21196239Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22196239Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23196239Simp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24196239Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25196239Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26196239Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27196239Simp * SUCH DAMAGE.
28196239Simp *
29196239Simp *	JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04
30217612Sjmallett * $FreeBSD: stable/11/sys/conf/ldscript.mips.mips64 317145 2017-04-19 15:33:24Z emaste $
31196239Simp */
32196239Simp
33196239SimpOUTPUT_ARCH(mips)
34196239SimpENTRY(_start)
35196239SimpSEARCH_DIR(/usr/lib);
36217655Simp
37196239SimpSECTIONS
38196239Simp{
39196239Simp  /* Read-only sections, merged into text segment: */
40197003Simp  . = KERNLOADADDR + SIZEOF_HEADERS;
41196239Simp  .interp     : { *(.interp) 	}
42196239Simp  .hash          : { *(.hash)		}
43196239Simp  .dynsym        : { *(.dynsym)		}
44196239Simp  .dynstr        : { *(.dynstr)		}
45196239Simp  .gnu.version   : { *(.gnu.version)	}
46196239Simp  .gnu.version_d   : { *(.gnu.version_d)	}
47196239Simp  .gnu.version_r   : { *(.gnu.version_r)	}
48196239Simp  .rel.init      : { *(.rel.init)	}
49196239Simp  .rela.init     : { *(.rela.init)	}
50196239Simp  .rel.text      :
51196239Simp    {
52196239Simp      *(.rel.text)
53196239Simp      *(.rel.text.*)
54196239Simp      *(.rel.gnu.linkonce.t.*)
55196239Simp    }
56196239Simp  .rela.text     :
57196239Simp    {
58196239Simp      *(.rela.text)
59196239Simp      *(.rela.text.*)
60196239Simp      *(.rela.gnu.linkonce.t.*)
61196239Simp    }
62196239Simp  .rel.fini      : { *(.rel.fini)	}
63196239Simp  .rela.fini     : { *(.rela.fini)	}
64196239Simp  .rel.rodata    :
65196239Simp    {
66196239Simp      *(.rel.rodata)
67196239Simp      *(.rel.rodata.*)
68196239Simp      *(.rel.gnu.linkonce.r.*)
69196239Simp    }
70196239Simp  .rela.rodata   :
71196239Simp    {
72196239Simp      *(.rela.rodata)
73196239Simp      *(.rela.rodata.*)
74196239Simp      *(.rela.gnu.linkonce.r.*)
75196239Simp    }
76196239Simp  .rel.data      :
77196239Simp    {
78196239Simp      *(.rel.data)
79196239Simp      *(.rel.data.*)
80196239Simp      *(.rel.gnu.linkonce.d.*)
81196239Simp    }
82196239Simp  .rela.data     :
83196239Simp    {
84196239Simp      *(.rela.data)
85196239Simp      *(.rela.data.*)
86196239Simp      *(.rela.gnu.linkonce.d.*)
87196239Simp    }
88196239Simp  .rel.ctors     : { *(.rel.ctors)	}
89196239Simp  .rela.ctors    : { *(.rela.ctors)	}
90196239Simp  .rel.dtors     : { *(.rel.dtors)	}
91196239Simp  .rela.dtors    : { *(.rela.dtors)	}
92196239Simp  .rel.got       : { *(.rel.got)		}
93196239Simp  .rela.got      : { *(.rela.got)		}
94196239Simp  .rel.sdata     :
95196239Simp    {
96196239Simp      *(.rel.sdata)
97196239Simp      *(.rel.sdata.*)
98196239Simp      *(.rel.gnu.linkonce.s.*)
99196239Simp    }
100196239Simp  .rela.sdata     :
101196239Simp    {
102196239Simp      *(.rela.sdata)
103196239Simp      *(.rela.sdata.*)
104196239Simp      *(.rela.gnu.linkonce.s.*)
105196239Simp    }
106196239Simp  .rel.sbss      :
107196239Simp    { 
108196239Simp      *(.rel.sbss)
109196239Simp      *(.rel.sbss.*)
110196239Simp      *(.rel.gnu.linkonce.sb.*)
111196239Simp    }
112196239Simp  .rela.sbss     :
113196239Simp    {
114196239Simp      *(.rela.sbss)
115196239Simp      *(.rela.sbss.*)
116196239Simp      *(.rel.gnu.linkonce.sb.*)
117196239Simp    }
118196239Simp  .rel.sdata2    : 
119196239Simp    { 
120196239Simp      *(.rel.sdata2)
121196239Simp      *(.rel.sdata2.*)
122196239Simp      *(.rel.gnu.linkonce.s2.*)
123196239Simp    }
124196239Simp  .rela.sdata2   : 
125196239Simp    {
126196239Simp      *(.rela.sdata2)
127196239Simp      *(.rela.sdata2.*)
128196239Simp      *(.rela.gnu.linkonce.s2.*)
129196239Simp    }
130196239Simp  .rel.sbss2     : 
131196239Simp    { 
132196239Simp      *(.rel.sbss2)	
133196239Simp      *(.rel.sbss2.*)
134196239Simp      *(.rel.gnu.linkonce.sb2.*)
135196239Simp    }
136196239Simp  .rela.sbss2    : 
137196239Simp    { 
138196239Simp      *(.rela.sbss2)	
139196239Simp      *(.rela.sbss2.*)
140196239Simp      *(.rela.gnu.linkonce.sb2.*)
141196239Simp    }
142196239Simp  .rel.bss       : 
143196239Simp    { 
144196239Simp      *(.rel.bss)
145196239Simp      *(.rel.bss.*)
146196239Simp      *(.rel.gnu.linkonce.b.*)
147196239Simp    }
148196239Simp  .rela.bss      : 
149196239Simp    { 
150196239Simp      *(.rela.bss)
151196239Simp      *(.rela.bss.*)
152196239Simp      *(.rela.gnu.linkonce.b.*)
153196239Simp    }
154196239Simp  .rel.plt       : { *(.rel.plt)		}
155196239Simp  .rela.plt      : { *(.rela.plt)		}
156196239Simp  .init          : 
157196239Simp  { 
158196239Simp    KEEP (*(.init))
159196239Simp  } =0x1000000
160196239Simp  .text      :
161196239Simp  {
162196239Simp    *(.trap)
163196239Simp    *(.text)
164196239Simp    *(.text.*)
165196239Simp    *(.stub)
166196239Simp    /* .gnu.warning sections are handled specially by elf64.em.  */
167196239Simp    *(.gnu.warning)
168196239Simp    *(.gnu.linkonce.t.*)
169196239Simp  } =0x1000000
170196239Simp  .fini      :
171196239Simp  {
172196239Simp    KEEP (*(.fini))
173196239Simp  } =0x1000000
174196239Simp  PROVIDE (__etext = .);
175196239Simp  PROVIDE (_etext = .);
176196239Simp  PROVIDE (etext = .);
177196239Simp  .rodata   : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) }
178196239Simp  .rodata1   : { *(.rodata1) }
179196239Simp  .reginfo : { *(.reginfo) }
180196239Simp  .sdata2   : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) }
181196239Simp  .sbss2   : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) }
182196239Simp  . = ALIGN(0x2000) + (. & (0x2000 - 1));
183196239Simp  .data    :
184196239Simp  {
185196239Simp    *(.data)
186196239Simp    *(.data.*)
187196239Simp    *(.gnu.linkonce.d.*)
188196239Simp  }
189196239Simp  .data1   : { *(.data1) }
190196239Simp  .eh_frame : { KEEP (*(.eh_frame)) }
191196239Simp  .gcc_except_table : { *(.gcc_except_table) }
192196239Simp  .ctors   : 
193196239Simp  {
194196239Simp    /* gcc uses crtbegin.o to find the start of
195196239Simp       the constructors, so we make sure it is
196196239Simp       first.  Because this is a wildcard, it
197196239Simp       doesn't matter if the user does not
198196239Simp       actually link against crtbegin.o; the
199196239Simp       linker won't look for a file to match a
200196239Simp       wildcard.  The wildcard also means that it
201196239Simp       doesn't matter which directory crtbegin.o
202196239Simp       is in.  */
203196239Simp    KEEP (*crtbegin.o(.ctors))
204196239Simp    /* We don't want to include the .ctor section from
205196239Simp       from the crtend.o file until after the sorted ctors.
206196239Simp       The .ctor section from the crtend file contains the
207196239Simp       end of ctors marker and it must be last */
208196239Simp    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
209196239Simp    KEEP (*(SORT(.ctors.*)))
210196239Simp    KEEP (*(.ctors))
211196239Simp  }
212196239Simp   .dtors         :
213196239Simp  {
214196239Simp    KEEP (*crtbegin.o(.dtors))
215196239Simp    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
216196239Simp    KEEP (*(SORT(.dtors.*)))
217196239Simp    KEEP (*(.dtors))
218196239Simp  }
219196239Simp  .plt      : { *(.plt)	}
220196239Simp  _gp = ALIGN(16) + 0x7ff0;
221196239Simp  .got		  : { *(.got.plt) *(.got) }
222196239Simp  .dynamic       : { *(.dynamic) }
223196239Simp  /* We want the small data sections together, so single-instruction offsets
224196239Simp     can access them all, and initialized data all before uninitialized, so
225196239Simp     we can shorten the on-disk segment size.  */
226196239Simp  .sdata     : 
227196239Simp  {
228196239Simp    *(.sdata) 
229196239Simp    *(.sdata.*)
230196239Simp    *(.gnu.linkonce.s.*)
231196239Simp  }
232196239Simp  _edata = .;
233196239Simp  PROVIDE (edata = .);
234196239Simp  __bss_start = .;
235196239Simp  .sbss      :
236196239Simp  {
237196239Simp    PROVIDE (__sbss_start = .);
238196239Simp    PROVIDE (___sbss_start = .);
239196239Simp    *(.dynsbss)
240196239Simp    *(.sbss)
241196239Simp    *(.sbss.*)
242196239Simp    *(.gnu.linkonce.sb.*)
243196239Simp    *(.scommon)
244196239Simp    PROVIDE (__sbss_end = .);
245196239Simp    PROVIDE (___sbss_end = .);
246196239Simp  }
247196239Simp  .bss       :
248196239Simp  {
249196239Simp   *(.dynbss)
250196239Simp   *(.bss)
251196239Simp   *(.bss.*)
252196239Simp   *(.gnu.linkonce.b.*)
253196239Simp   *(COMMON)
254196239Simp   /* Align here to ensure that the .bss section occupies space up to
255196239Simp      _end.  Align after .bss to ensure correct alignment even if the
256196239Simp      .bss section disappears because there are no input sections.  */
257196239Simp   . = ALIGN(64 / 8);
258196239Simp  }
259196239Simp  . = ALIGN(64 / 8);
260196239Simp  _end = .;
261196239Simp  PROVIDE (end = .);
262196239Simp  /* Stabs debugging sections.  */
263196239Simp  .stab 0 : { *(.stab) }
264196239Simp  .stabstr 0 : { *(.stabstr) }
265196239Simp  .stab.excl 0 : { *(.stab.excl) }
266196239Simp  .stab.exclstr 0 : { *(.stab.exclstr) }
267196239Simp  .stab.index 0 : { *(.stab.index) }
268196239Simp  .stab.indexstr 0 : { *(.stab.indexstr) }
269196239Simp  .comment 0 : { *(.comment) }
270196239Simp  /* DWARF debug sections.
271196239Simp     Symbols in the DWARF debugging sections are relative to the beginning
272196239Simp     of the section so we begin them at 0.  */
273196239Simp  /* DWARF 1 */
274196239Simp  .debug          0 : { *(.debug) }
275196239Simp  .line           0 : { *(.line) }
276196239Simp  /* GNU DWARF 1 extensions */
277196239Simp  .debug_srcinfo  0 : { *(.debug_srcinfo) }
278196239Simp  .debug_sfnames  0 : { *(.debug_sfnames) }
279196239Simp  /* DWARF 1.1 and DWARF 2 */
280196239Simp  .debug_aranges  0 : { *(.debug_aranges) }
281196239Simp  .debug_pubnames 0 : { *(.debug_pubnames) }
282196239Simp  /* DWARF 2 */
283196239Simp  .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
284196239Simp  .debug_abbrev   0 : { *(.debug_abbrev) }
285196239Simp  .debug_line     0 : { *(.debug_line) }
286196239Simp  .debug_frame    0 : { *(.debug_frame) }
287196239Simp  .debug_str      0 : { *(.debug_str) }
288196239Simp  .debug_loc      0 : { *(.debug_loc) }
289196239Simp  .debug_macinfo  0 : { *(.debug_macinfo) }
290196239Simp  /* SGI/MIPS DWARF 2 extensions */
291196239Simp  .debug_weaknames 0 : { *(.debug_weaknames) }
292196239Simp  .debug_funcnames 0 : { *(.debug_funcnames) }
293196239Simp  .debug_typenames 0 : { *(.debug_typenames) }
294196239Simp  .debug_varnames  0 : { *(.debug_varnames) }
295196239Simp  /* These must appear regardless of  .  */
296196239Simp}
297