ldscript.mips.mips64 revision 217612
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: head/sys/conf/ldscript.mips.mips64 217612 2011-01-19 22:15:12Z jmallett $
31196239Simp */
32196239Simp
33196239SimpOUTPUT_ARCH(mips)
34196239SimpENTRY(_start)
35196239SimpSEARCH_DIR(/usr/lib);
36196239Simp/* Do we need any of these for elf?
37196239Simp   __DYNAMIC = 0;
38196239SimpPROVIDE (_DYNAMIC = 0);
39196239Simp*/
40196239SimpSECTIONS
41196239Simp{
42196239Simp  /* Read-only sections, merged into text segment: */
43197003Simp  . = KERNLOADADDR + SIZEOF_HEADERS;
44196239Simp  .interp     : { *(.interp) 	}
45196239Simp  .hash          : { *(.hash)		}
46196239Simp  .dynsym        : { *(.dynsym)		}
47196239Simp  .dynstr        : { *(.dynstr)		}
48196239Simp  .gnu.version   : { *(.gnu.version)	}
49196239Simp  .gnu.version_d   : { *(.gnu.version_d)	}
50196239Simp  .gnu.version_r   : { *(.gnu.version_r)	}
51196239Simp  .rel.init      : { *(.rel.init)	}
52196239Simp  .rela.init     : { *(.rela.init)	}
53196239Simp  .rel.text      :
54196239Simp    {
55196239Simp      *(.rel.text)
56196239Simp      *(.rel.text.*)
57196239Simp      *(.rel.gnu.linkonce.t.*)
58196239Simp    }
59196239Simp  .rela.text     :
60196239Simp    {
61196239Simp      *(.rela.text)
62196239Simp      *(.rela.text.*)
63196239Simp      *(.rela.gnu.linkonce.t.*)
64196239Simp    }
65196239Simp  .rel.fini      : { *(.rel.fini)	}
66196239Simp  .rela.fini     : { *(.rela.fini)	}
67196239Simp  .rel.rodata    :
68196239Simp    {
69196239Simp      *(.rel.rodata)
70196239Simp      *(.rel.rodata.*)
71196239Simp      *(.rel.gnu.linkonce.r.*)
72196239Simp    }
73196239Simp  .rela.rodata   :
74196239Simp    {
75196239Simp      *(.rela.rodata)
76196239Simp      *(.rela.rodata.*)
77196239Simp      *(.rela.gnu.linkonce.r.*)
78196239Simp    }
79196239Simp  .rel.data      :
80196239Simp    {
81196239Simp      *(.rel.data)
82196239Simp      *(.rel.data.*)
83196239Simp      *(.rel.gnu.linkonce.d.*)
84196239Simp    }
85196239Simp  .rela.data     :
86196239Simp    {
87196239Simp      *(.rela.data)
88196239Simp      *(.rela.data.*)
89196239Simp      *(.rela.gnu.linkonce.d.*)
90196239Simp    }
91196239Simp  .rel.ctors     : { *(.rel.ctors)	}
92196239Simp  .rela.ctors    : { *(.rela.ctors)	}
93196239Simp  .rel.dtors     : { *(.rel.dtors)	}
94196239Simp  .rela.dtors    : { *(.rela.dtors)	}
95196239Simp  .rel.got       : { *(.rel.got)		}
96196239Simp  .rela.got      : { *(.rela.got)		}
97196239Simp  .rel.sdata     :
98196239Simp    {
99196239Simp      *(.rel.sdata)
100196239Simp      *(.rel.sdata.*)
101196239Simp      *(.rel.gnu.linkonce.s.*)
102196239Simp    }
103196239Simp  .rela.sdata     :
104196239Simp    {
105196239Simp      *(.rela.sdata)
106196239Simp      *(.rela.sdata.*)
107196239Simp      *(.rela.gnu.linkonce.s.*)
108196239Simp    }
109196239Simp  .rel.sbss      :
110196239Simp    { 
111196239Simp      *(.rel.sbss)
112196239Simp      *(.rel.sbss.*)
113196239Simp      *(.rel.gnu.linkonce.sb.*)
114196239Simp    }
115196239Simp  .rela.sbss     :
116196239Simp    {
117196239Simp      *(.rela.sbss)
118196239Simp      *(.rela.sbss.*)
119196239Simp      *(.rel.gnu.linkonce.sb.*)
120196239Simp    }
121196239Simp  .rel.sdata2    : 
122196239Simp    { 
123196239Simp      *(.rel.sdata2)
124196239Simp      *(.rel.sdata2.*)
125196239Simp      *(.rel.gnu.linkonce.s2.*)
126196239Simp    }
127196239Simp  .rela.sdata2   : 
128196239Simp    {
129196239Simp      *(.rela.sdata2)
130196239Simp      *(.rela.sdata2.*)
131196239Simp      *(.rela.gnu.linkonce.s2.*)
132196239Simp    }
133196239Simp  .rel.sbss2     : 
134196239Simp    { 
135196239Simp      *(.rel.sbss2)	
136196239Simp      *(.rel.sbss2.*)
137196239Simp      *(.rel.gnu.linkonce.sb2.*)
138196239Simp    }
139196239Simp  .rela.sbss2    : 
140196239Simp    { 
141196239Simp      *(.rela.sbss2)	
142196239Simp      *(.rela.sbss2.*)
143196239Simp      *(.rela.gnu.linkonce.sb2.*)
144196239Simp    }
145196239Simp  .rel.bss       : 
146196239Simp    { 
147196239Simp      *(.rel.bss)
148196239Simp      *(.rel.bss.*)
149196239Simp      *(.rel.gnu.linkonce.b.*)
150196239Simp    }
151196239Simp  .rela.bss      : 
152196239Simp    { 
153196239Simp      *(.rela.bss)
154196239Simp      *(.rela.bss.*)
155196239Simp      *(.rela.gnu.linkonce.b.*)
156196239Simp    }
157196239Simp  .rel.plt       : { *(.rel.plt)		}
158196239Simp  .rela.plt      : { *(.rela.plt)		}
159196239Simp  .init          : 
160196239Simp  { 
161196239Simp    KEEP (*(.init))
162196239Simp  } =0x1000000
163196239Simp  .text      :
164196239Simp  {
165196239Simp    *(.trap)
166196239Simp    *(.text)
167196239Simp    *(.text.*)
168196239Simp    *(.stub)
169196239Simp    /* .gnu.warning sections are handled specially by elf64.em.  */
170196239Simp    *(.gnu.warning)
171196239Simp    *(.gnu.linkonce.t.*)
172196239Simp  } =0x1000000
173196239Simp  .fini      :
174196239Simp  {
175196239Simp    KEEP (*(.fini))
176196239Simp  } =0x1000000
177196239Simp  PROVIDE (__etext = .);
178196239Simp  PROVIDE (_etext = .);
179196239Simp  PROVIDE (etext = .);
180196239Simp  .rodata   : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) }
181196239Simp  .rodata1   : { *(.rodata1) }
182196239Simp  .reginfo : { *(.reginfo) }
183196239Simp  .sdata2   : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) }
184196239Simp  .sbss2   : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) }
185196239Simp  . = ALIGN(0x2000) + (. & (0x2000 - 1));
186196239Simp  .data    :
187196239Simp  {
188196239Simp    *(.data)
189196239Simp    *(.data.*)
190196239Simp    *(.gnu.linkonce.d.*)
191196239Simp    SORT(CONSTRUCTORS)
192196239Simp  }
193196239Simp  .data1   : { *(.data1) }
194196239Simp  .eh_frame : { KEEP (*(.eh_frame)) }
195196239Simp  .gcc_except_table : { *(.gcc_except_table) }
196196239Simp  .ctors   : 
197196239Simp  {
198196239Simp    /* gcc uses crtbegin.o to find the start of
199196239Simp       the constructors, so we make sure it is
200196239Simp       first.  Because this is a wildcard, it
201196239Simp       doesn't matter if the user does not
202196239Simp       actually link against crtbegin.o; the
203196239Simp       linker won't look for a file to match a
204196239Simp       wildcard.  The wildcard also means that it
205196239Simp       doesn't matter which directory crtbegin.o
206196239Simp       is in.  */
207196239Simp    KEEP (*crtbegin.o(.ctors))
208196239Simp    /* We don't want to include the .ctor section from
209196239Simp       from the crtend.o file until after the sorted ctors.
210196239Simp       The .ctor section from the crtend file contains the
211196239Simp       end of ctors marker and it must be last */
212196239Simp    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
213196239Simp    KEEP (*(SORT(.ctors.*)))
214196239Simp    KEEP (*(.ctors))
215196239Simp  }
216196239Simp   .dtors         :
217196239Simp  {
218196239Simp    KEEP (*crtbegin.o(.dtors))
219196239Simp    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
220196239Simp    KEEP (*(SORT(.dtors.*)))
221196239Simp    KEEP (*(.dtors))
222196239Simp  }
223196239Simp  .plt      : { *(.plt)	}
224196239Simp  _gp = ALIGN(16) + 0x7ff0;
225196239Simp  .got		  : { *(.got.plt) *(.got) }
226196239Simp  .dynamic       : { *(.dynamic) }
227196239Simp  /* We want the small data sections together, so single-instruction offsets
228196239Simp     can access them all, and initialized data all before uninitialized, so
229196239Simp     we can shorten the on-disk segment size.  */
230196239Simp  .sdata     : 
231196239Simp  {
232196239Simp    *(.sdata) 
233196239Simp    *(.sdata.*)
234196239Simp    *(.gnu.linkonce.s.*)
235196239Simp  }
236196239Simp  _edata = .;
237196239Simp  PROVIDE (edata = .);
238196239Simp  __bss_start = .;
239196239Simp  .sbss      :
240196239Simp  {
241196239Simp    PROVIDE (__sbss_start = .);
242196239Simp    PROVIDE (___sbss_start = .);
243196239Simp    *(.dynsbss)
244196239Simp    *(.sbss)
245196239Simp    *(.sbss.*)
246196239Simp    *(.gnu.linkonce.sb.*)
247196239Simp    *(.scommon)
248196239Simp    PROVIDE (__sbss_end = .);
249196239Simp    PROVIDE (___sbss_end = .);
250196239Simp  }
251196239Simp  .bss       :
252196239Simp  {
253196239Simp   *(.dynbss)
254196239Simp   *(.bss)
255196239Simp   *(.bss.*)
256196239Simp   *(.gnu.linkonce.b.*)
257196239Simp   *(COMMON)
258196239Simp   /* Align here to ensure that the .bss section occupies space up to
259196239Simp      _end.  Align after .bss to ensure correct alignment even if the
260196239Simp      .bss section disappears because there are no input sections.  */
261196239Simp   . = ALIGN(64 / 8);
262196239Simp  }
263196239Simp  . = ALIGN(64 / 8);
264196239Simp  _end = .;
265196239Simp  PROVIDE (end = .);
266196239Simp  /* Stabs debugging sections.  */
267196239Simp  .stab 0 : { *(.stab) }
268196239Simp  .stabstr 0 : { *(.stabstr) }
269196239Simp  .stab.excl 0 : { *(.stab.excl) }
270196239Simp  .stab.exclstr 0 : { *(.stab.exclstr) }
271196239Simp  .stab.index 0 : { *(.stab.index) }
272196239Simp  .stab.indexstr 0 : { *(.stab.indexstr) }
273196239Simp  .comment 0 : { *(.comment) }
274196239Simp  /* DWARF debug sections.
275196239Simp     Symbols in the DWARF debugging sections are relative to the beginning
276196239Simp     of the section so we begin them at 0.  */
277196239Simp  /* DWARF 1 */
278196239Simp  .debug          0 : { *(.debug) }
279196239Simp  .line           0 : { *(.line) }
280196239Simp  /* GNU DWARF 1 extensions */
281196239Simp  .debug_srcinfo  0 : { *(.debug_srcinfo) }
282196239Simp  .debug_sfnames  0 : { *(.debug_sfnames) }
283196239Simp  /* DWARF 1.1 and DWARF 2 */
284196239Simp  .debug_aranges  0 : { *(.debug_aranges) }
285196239Simp  .debug_pubnames 0 : { *(.debug_pubnames) }
286196239Simp  /* DWARF 2 */
287196239Simp  .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
288196239Simp  .debug_abbrev   0 : { *(.debug_abbrev) }
289196239Simp  .debug_line     0 : { *(.debug_line) }
290196239Simp  .debug_frame    0 : { *(.debug_frame) }
291196239Simp  .debug_str      0 : { *(.debug_str) }
292196239Simp  .debug_loc      0 : { *(.debug_loc) }
293196239Simp  .debug_macinfo  0 : { *(.debug_macinfo) }
294196239Simp  /* SGI/MIPS DWARF 2 extensions */
295196239Simp  .debug_weaknames 0 : { *(.debug_weaknames) }
296196239Simp  .debug_funcnames 0 : { *(.debug_funcnames) }
297196239Simp  .debug_typenames 0 : { *(.debug_typenames) }
298196239Simp  .debug_varnames  0 : { *(.debug_varnames) }
299196239Simp  /* These must appear regardless of  .  */
300196239Simp}
301