]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ldscripts/ARCH-sparc/main_rel.ld
update
[l4.git] / l4 / pkg / ldscripts / ARCH-sparc / main_rel.ld
1 /* Script for ld --shared: link shared library */
2 OUTPUT_FORMAT("elf32-sparc", "elf32-sparc",
3               "elf32-sparc")
4 OUTPUT_ARCH(sparc)
5 ENTRY(_start)
6
7 SECTIONS
8 {
9   /* Read-only sections, merged into text segment: */
10   . = 0 + SIZEOF_HEADERS;
11   .note.gnu.build-id : { *(.note.gnu.build-id) }
12   .hash           : { *(.hash) }
13   .gnu.hash       : { *(.gnu.hash) }
14   .dynsym         : { *(.dynsym) }
15   .dynstr         : { *(.dynstr) }
16   .gnu.version    : { *(.gnu.version) }
17   .gnu.version_d  : { *(.gnu.version_d) }
18   .gnu.version_r  : { *(.gnu.version_r) }
19   .rel.dyn        :
20     {
21       *(.rel.init)
22       *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
23       *(.rel.fini)
24       *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
25       *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
26       *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
27       *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
28       *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
29       *(.rel.ctors)
30       *(.rel.dtors)
31       *(.rel.got)
32       *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
33       *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
34       *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
35       *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
36       *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
37     }
38   .rela.dyn       :
39     {
40       *(.rela.init)
41       *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
42       *(.rela.fini)
43       *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
44       *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
45       *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
46       *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
47       *(.rela.ctors)
48       *(.rela.dtors)
49       *(.rela.got)
50       *(.rela.got1)
51       *(.rela.got2)
52       *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
53       *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
54       *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
55       *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
56       *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
57     }
58   .rel.plt        : { *(.rel.plt) }
59   .rela.plt       : { *(.rela.plt) }
60   .init           :
61   {
62     KEEP (*(.init))
63   } =0
64   .text           :
65   {
66     *(.text .stub .text.* .gnu.linkonce.t.*)
67     KEEP (*(.text.*personality*))
68     /* .gnu.warning sections are handled specially by elf32.em.  */
69     *(.gnu.warning)
70     *(.glink)
71   } =0
72   .fini           :
73   {
74     KEEP (*(.fini))
75   } =0
76   PROVIDE (__etext = .);
77   PROVIDE (_etext = .);
78   PROVIDE (etext = .);
79   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
80   .rodata1        : { *(.rodata1) }
81   .eh_frame_hdr : { *(.eh_frame_hdr) }
82   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
83   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
84   /* Adjust the address for the data segment.  We want to adjust up to
85      the same address within the page on the next page up.  */
86   . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
87   /* Exception handling  */
88   .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
89   .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
90   /* Thread Local Storage sections  */
91   .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
92   .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
93   .preinit_array     :
94   {
95     KEEP (*(.preinit_array))
96   }
97   .init_array     :
98   {
99      KEEP (*(SORT(.init_array.*)))
100      KEEP (*(.init_array))
101   }
102   .fini_array     :
103   {
104     KEEP (*(.fini_array))
105     KEEP (*(SORT(.fini_array.*)))
106   }
107   .ctors          :
108   {
109     /* gcc uses crtbegin.o to find the start of
110        the constructors, so we make sure it is
111        first.  Because this is a wildcard, it
112        doesn't matter if the user does not
113        actually link against crtbegin.o; the
114        linker won't look for a file to match a
115        wildcard.  The wildcard also means that it
116        doesn't matter which directory crtbegin.o
117        is in.  */
118     KEEP (*crtbegin.o(.ctors))
119     KEEP (*crtbegin?.o(.ctors))
120     /* We don't want to include the .ctor section from
121        the crtend.o file until after the sorted ctors.
122        The .ctor section from the crtend file contains the
123        end of ctors marker and it must be last */
124     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
125     KEEP (*(SORT(.ctors.*)))
126     KEEP (*(.ctors))
127   }
128   .dtors          :
129   {
130     KEEP (*crtbegin.o(.dtors))
131     KEEP (*crtbegin?.o(.dtors))
132     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
133     KEEP (*(SORT(.dtors.*)))
134     KEEP (*(.dtors))
135   }
136   __DTOR_END__ = .;
137   .jcr            : { KEEP (*(.jcr)) }
138   .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
139   .got1           : { *(.got1) }
140   .got2           : { *(.got2) }
141   .dynamic        : { *(.dynamic) }
142   .got            : SPECIAL { *(.got) }
143   . = DATA_SEGMENT_RELRO_END (0, .);
144   .plt            : SPECIAL { *(.plt) }
145   .data           :
146   {
147     *(.data .data.* .gnu.linkonce.d.*)
148     KEEP (*(.gnu.linkonce.d.*personality*))
149     SORT(CONSTRUCTORS)
150   }
151   .data1          : { *(.data1) }
152   .got            : SPECIAL { *(.got) }
153   /* We want the small data sections together, so single-instruction offsets
154      can access them all, and initialized data all before uninitialized, so
155      we can shorten the on-disk segment size.  */
156   .sdata          :
157   {
158     *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
159     *(.sdata .sdata.* .gnu.linkonce.s.*)
160   }
161   _edata = .; PROVIDE (edata = .);
162   __bss_start = .;
163   .sbss           :
164   {
165     *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
166     *(.dynsbss)
167     *(.sbss .sbss.* .gnu.linkonce.sb.*)
168     *(.scommon)
169   }
170   .plt            : SPECIAL { *(.plt) }
171   .bss            :
172   {
173    *(.dynbss)
174    *(.bss .bss.* .gnu.linkonce.b.*)
175    *(COMMON)
176    /* Align here to ensure that the .bss section occupies space up to
177       _end.  Align after .bss to ensure correct alignment even if the
178       .bss section disappears because there are no input sections.
179       FIXME: Why do we need it? When there is no .bss section, we don't
180       pad the .data section.  */
181    . = ALIGN(. != 0 ? 32 / 8 : 1);
182   }
183   . = ALIGN(32 / 8);
184   . = ALIGN(32 / 8);
185   _end = .; PROVIDE (end = .);
186   . = DATA_SEGMENT_END (.);
187   /* Stabs debugging sections.  */
188   .stab          0 : { *(.stab) }
189   .stabstr       0 : { *(.stabstr) }
190   .stab.excl     0 : { *(.stab.excl) }
191   .stab.exclstr  0 : { *(.stab.exclstr) }
192   .stab.index    0 : { *(.stab.index) }
193   .stab.indexstr 0 : { *(.stab.indexstr) }
194   .comment       0 : { *(.comment) }
195   /* DWARF debug sections.
196      Symbols in the DWARF debugging sections are relative to the beginning
197      of the section so we begin them at 0.  */
198   /* DWARF 1 */
199   .debug          0 : { *(.debug) }
200   .line           0 : { *(.line) }
201   /* GNU DWARF 1 extensions */
202   .debug_srcinfo  0 : { *(.debug_srcinfo) }
203   .debug_sfnames  0 : { *(.debug_sfnames) }
204   /* DWARF 1.1 and DWARF 2 */
205   .debug_aranges  0 : { *(.debug_aranges) }
206   .debug_pubnames 0 : { *(.debug_pubnames) }
207   /* DWARF 2 */
208   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
209   .debug_abbrev   0 : { *(.debug_abbrev) }
210   .debug_line     0 : { *(.debug_line) }
211   .debug_frame    0 : { *(.debug_frame) }
212   .debug_str      0 : { *(.debug_str) }
213   .debug_loc      0 : { *(.debug_loc) }
214   .debug_macinfo  0 : { *(.debug_macinfo) }
215   /* SGI/MIPS DWARF 2 extensions */
216   .debug_weaknames 0 : { *(.debug_weaknames) }
217   .debug_funcnames 0 : { *(.debug_funcnames) }
218   .debug_typenames 0 : { *(.debug_typenames) }
219   .debug_varnames  0 : { *(.debug_varnames) }
220   /* DWARF 3 */
221   .debug_pubtypes 0 : { *(.debug_pubtypes) }
222   .debug_ranges   0 : { *(.debug_ranges) }
223   .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
224   /DISCARD/     : { *(.fixup) }
225   /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
226 }