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