chiark / gitweb /
volume_id: provide libvolume_id.a file
[elogind.git] / klibc / klibc / arch / mips / klibc.ld
1 /* Linker script for klibc.so, needed because of the the damned
2    GNU ld script headers problem */
3
4 OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
5               "elf32-tradlittlemips")
6 OUTPUT_ARCH(mips)
7 ENTRY(__start)
8 SECTIONS
9 {
10   /* Read-only sections, merged into text segment: */
11   /* This address needs to be reachable using normal inter-module
12       calls, and work on the memory models for this architecture */
13   /* 2 MB -- the normal starting point for text is 4 MB */
14   . = 0x00200400;
15   .interp         : { *(.interp) }
16   .reginfo        : { *(.reginfo) }
17   .dynamic        : { *(.dynamic) }
18   .hash           : { *(.hash) }
19   .dynsym         : { *(.dynsym) }
20   .dynstr         : { *(.dynstr) }
21   .gnu.version    : { *(.gnu.version) }
22   .gnu.version_d  : { *(.gnu.version_d) }
23   .gnu.version_r  : { *(.gnu.version_r) }
24   .rel.dyn        :
25     {
26       *(.rel.init)
27       *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
28       *(.rel.fini)
29       *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
30       *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
31       *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
32       *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
33       *(.rel.ctors)
34       *(.rel.dtors)
35       *(.rel.got)
36       *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
37       *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
38       *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
39       *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
40       *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
41     }
42   .rela.dyn       :
43     {
44       *(.rela.init)
45       *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
46       *(.rela.fini)
47       *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
48       *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
49       *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
50       *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
51       *(.rela.ctors)
52       *(.rela.dtors)
53       *(.rela.got)
54       *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
55       *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
56       *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
57       *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
58       *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
59     }
60   .rel.plt        : { *(.rel.plt) }
61   .rela.plt       : { *(.rela.plt) }
62   .init           :
63   {
64     KEEP (*(.init))
65   } =0
66   .plt            : { *(.plt) }
67   .text           :
68   {
69     _ftext = . ;
70     *(.text .stub .text.* .gnu.linkonce.t.*)
71     /* .gnu.warning sections are handled specially by elf32.em.  */
72     *(.gnu.warning)
73     *(.mips16.fn.*) *(.mips16.call.*)
74   } =0
75   .fini           :
76   {
77     KEEP (*(.fini))
78   } =0
79   PROVIDE (__etext = .);
80   PROVIDE (_etext = .);
81   PROVIDE (etext = .);
82   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
83   .rodata1        : { *(.rodata1) }
84   .sdata2         : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
85   .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
86   .eh_frame_hdr : { *(.eh_frame_hdr) }
87   /* Adjust the address for the data segment.  We want to adjust up to
88      the same address within the page on the next page up.  */
89   . = ALIGN(8192);
90   /* Ensure the __preinit_array_start label is properly aligned.  We
91      could instead move the label definition inside the section, but
92      the linker would then create the section even if it turns out to
93      be empty, which isn't pretty.  */
94   . = ALIGN(32 / 8);
95   PROVIDE (__preinit_array_start = .);
96   .preinit_array     : { *(.preinit_array) }
97   PROVIDE (__preinit_array_end = .);
98   PROVIDE (__init_array_start = .);
99   .init_array     : { *(.init_array) }
100   PROVIDE (__init_array_end = .);
101   PROVIDE (__fini_array_start = .);
102   .fini_array     : { *(.fini_array) }
103   PROVIDE (__fini_array_end = .);
104   .data           :
105   {
106     _fdata = . ;
107     *(.data .data.* .gnu.linkonce.d.*)
108     SORT(CONSTRUCTORS)
109   }
110   .data1          : { *(.data1) }
111   .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
112   .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
113   .eh_frame       : { KEEP (*(.eh_frame)) }
114   .gcc_except_table   : { *(.gcc_except_table) }
115   .ctors          :
116   {
117     /* gcc uses crtbegin.o to find the start of
118        the constructors, so we make sure it is
119        first.  Because this is a wildcard, it
120        doesn't matter if the user does not
121        actually link against crtbegin.o; the
122        linker won't look for a file to match a
123        wildcard.  The wildcard also means that it
124        doesn't matter which directory crtbegin.o
125        is in.  */
126     KEEP (*crtbegin*.o(.ctors))
127     /* We don't want to include the .ctor section from
128        from the crtend.o file until after the sorted ctors.
129        The .ctor section from the crtend file contains the
130        end of ctors marker and it must be last */
131     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
132     KEEP (*(SORT(.ctors.*)))
133     KEEP (*(.ctors))
134   }
135   .dtors          :
136   {
137     KEEP (*crtbegin*.o(.dtors))
138     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
139     KEEP (*(SORT(.dtors.*)))
140     KEEP (*(.dtors))
141   }
142   .jcr            : { KEEP (*(.jcr)) }
143   _gp = ALIGN(16) + 0x7ff0;
144   .got            : { *(.got.plt) *(.got) }
145   /* We want the small data sections together, so single-instruction offsets
146      can access them all, and initialized data all before uninitialized, so
147      we can shorten the on-disk segment size.  */
148   .sdata          :
149   {
150     *(.sdata .sdata.* .gnu.linkonce.s.*)
151   }
152   .lit8           : { *(.lit8) }
153   .lit4           : { *(.lit4) }
154   _edata = .;
155   PROVIDE (edata = .);
156   __bss_start = .;
157   _fbss = .;
158   .sbss           :
159   {
160     PROVIDE (__sbss_start = .);
161     PROVIDE (___sbss_start = .);
162     *(.dynsbss)
163     *(.sbss .sbss.* .gnu.linkonce.sb.*)
164     *(.scommon)
165     PROVIDE (__sbss_end = .);
166     PROVIDE (___sbss_end = .);
167   }
168   .bss            :
169   {
170    *(.dynbss)
171    *(.bss .bss.* .gnu.linkonce.b.*)
172    *(COMMON)
173    /* Align here to ensure that the .bss section occupies space up to
174       _end.  Align after .bss to ensure correct alignment even if the
175       .bss section disappears because there are no input sections.  */
176    . = ALIGN(32 / 8);
177   }
178   . = ALIGN(32 / 8);
179   _end = .;
180   PROVIDE (end = .);
181   /* Stabs debugging sections.  */
182   .stab          0 : { *(.stab) }
183   .stabstr       0 : { *(.stabstr) }
184   .stab.excl     0 : { *(.stab.excl) }
185   .stab.exclstr  0 : { *(.stab.exclstr) }
186   .stab.index    0 : { *(.stab.index) }
187   .stab.indexstr 0 : { *(.stab.indexstr) }
188   .comment       0 : { *(.comment) }
189   /* DWARF debug sections.
190      Symbols in the DWARF debugging sections are relative to the beginning
191      of the section so we begin them at 0.  */
192   /* DWARF 1 */
193   .debug          0 : { *(.debug) }
194   .line           0 : { *(.line) }
195   /* GNU DWARF 1 extensions */
196   .debug_srcinfo  0 : { *(.debug_srcinfo) }
197   .debug_sfnames  0 : { *(.debug_sfnames) }
198   /* DWARF 1.1 and DWARF 2 */
199   .debug_aranges  0 : { *(.debug_aranges) }
200   .debug_pubnames 0 : { *(.debug_pubnames) }
201   /* DWARF 2 */
202   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
203   .debug_abbrev   0 : { *(.debug_abbrev) }
204   .debug_line     0 : { *(.debug_line) }
205   .debug_frame    0 : { *(.debug_frame) }
206   .debug_str      0 : { *(.debug_str) }
207   .debug_loc      0 : { *(.debug_loc) }
208   .debug_macinfo  0 : { *(.debug_macinfo) }
209   /* SGI/MIPS DWARF 2 extensions */
210   .debug_weaknames 0 : { *(.debug_weaknames) }
211   .debug_funcnames 0 : { *(.debug_funcnames) }
212   .debug_typenames 0 : { *(.debug_typenames) }
213   .debug_varnames  0 : { *(.debug_varnames) }
214   .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
215   .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
216   /DISCARD/ : { *(.note.GNU-stack) }
217 }