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