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