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