Major build system changes
[tpg/acess2.git] / Usermode / Libraries / acess.ld_src / acess_armv7.ld.h
1 /* Script for -z combreloc: combine and sort reloc sections */
2 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
3               "elf32-littlearm")
4 OUTPUT_ARCH(arm)
5 ENTRY(_start)
6 SEARCH_DIR(__LIBDIR)
7 INPUT(crt0.o)
8 SECTIONS
9 {
10   /* Read-only sections, merged into text segment: */
11   PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x8000)); . = SEGMENT_START("text-segment", 0x8000);
12   .interp         : { *(.interp) }
13   .note.gnu.build-id : { *(.note.gnu.build-id) }
14   .hash           : { *(.hash) }
15   .gnu.hash       : { *(.gnu.hash) }
16   .dynsym         : { *(.dynsym) }
17   .dynstr         : { *(.dynstr) }
18   .gnu.version    : { *(.gnu.version) }
19   .gnu.version_d  : { *(.gnu.version_d) }
20   .gnu.version_r  : { *(.gnu.version_r) }
21   .rel.dyn        :
22     {
23       *(.rel.init)
24       *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
25       *(.rel.fini)
26       *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
27       *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
28       *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
29       *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
30       *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
31       *(.rel.ctors)
32       *(.rel.dtors)
33       *(.rel.got)
34       *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
35       PROVIDE_HIDDEN (__rel_iplt_start = .);
36       *(.rel.iplt)
37       PROVIDE_HIDDEN (__rel_iplt_end = .);
38       PROVIDE_HIDDEN (__rela_iplt_start = .);
39       PROVIDE_HIDDEN (__rela_iplt_end = .);
40     }
41   .rela.dyn       :
42     {
43       *(.rela.init)
44       *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
45       *(.rela.fini)
46       *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
47       *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
48       *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
49       *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
50       *(.rela.ctors)
51       *(.rela.dtors)
52       *(.rela.got)
53       *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
54       PROVIDE_HIDDEN (__rel_iplt_start = .);
55       PROVIDE_HIDDEN (__rel_iplt_end = .);
56       PROVIDE_HIDDEN (__rela_iplt_start = .);
57       *(.rela.iplt)
58       PROVIDE_HIDDEN (__rela_iplt_end = .);
59     }
60   .rel.plt        :
61     {
62       *(.rel.plt)
63     }
64   .rela.plt       :
65     {
66       *(.rela.plt)
67     }
68   .init           :
69   {
70     KEEP (*(.init))
71   } =0
72   .plt            : { *(.plt) }
73   .iplt           : { *(.iplt) }
74   .text           :
75   {
76     *(.text.unlikely .text.*_unlikely)
77     *(.text.exit .text.exit.*)
78     *(.text.startup .text.startup.*)
79     *(.text.hot .text.hot.*)
80     *(.text .stub .text.* .gnu.linkonce.t.*)
81     /* .gnu.warning sections are handled specially by elf32.em.  */
82     *(.gnu.warning)
83     *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
84   } =0
85   .fini           :
86   {
87     KEEP (*(.fini))
88   } =0
89   PROVIDE (__etext = .);
90   PROVIDE (_etext = .);
91   PROVIDE (etext = .);
92   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
93   .rodata1        : { *(.rodata1) }
94   .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) }
95    PROVIDE_HIDDEN (__exidx_start = .);
96   .ARM.exidx   : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
97    PROVIDE_HIDDEN (__exidx_end = .);
98   .eh_frame_hdr : { *(.eh_frame_hdr) }
99   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
100   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
101   /* Adjust the address for the data segment.  We want to adjust up to
102      the same address within the page on the next page up.  */
103   . = ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1));
104   /* Exception handling  */
105   .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
106   .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
107   /* Thread Local Storage sections  */
108   .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
109   .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
110   .preinit_array     :
111   {
112     PROVIDE_HIDDEN (__preinit_array_start = .);
113     KEEP (*(.preinit_array))
114     PROVIDE_HIDDEN (__preinit_array_end = .);
115   }
116   .init_array     :
117   {
118     PROVIDE_HIDDEN (__init_array_start = .);
119     KEEP (*(SORT(.init_array.*)))
120     KEEP (*(.init_array))
121     PROVIDE_HIDDEN (__init_array_end = .);
122   }
123   .fini_array     :
124   {
125     PROVIDE_HIDDEN (__fini_array_start = .);
126     KEEP (*(SORT(.fini_array.*)))
127     KEEP (*(.fini_array))
128     PROVIDE_HIDDEN (__fini_array_end = .);
129   }
130   .ctors          :
131   {
132     /* gcc uses crtbegin.o to find the start of
133        the constructors, so we make sure it is
134        first.  Because this is a wildcard, it
135        doesn't matter if the user does not
136        actually link against crtbegin.o; the
137        linker won't look for a file to match a
138        wildcard.  The wildcard also means that it
139        doesn't matter which directory crtbegin.o
140        is in.  */
141     KEEP (*crtbegin.o(.ctors))
142     KEEP (*crtbegin?.o(.ctors))
143     /* We don't want to include the .ctor section from
144        the crtend.o file until after the sorted ctors.
145        The .ctor section from the crtend file contains the
146        end of ctors marker and it must be last */
147     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
148     KEEP (*(SORT(.ctors.*)))
149     KEEP (*(.ctors))
150   }
151   .dtors          :
152   {
153     KEEP (*crtbegin.o(.dtors))
154     KEEP (*crtbegin?.o(.dtors))
155     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
156     KEEP (*(SORT(.dtors.*)))
157     KEEP (*(.dtors))
158   }
159   .jcr            : { KEEP (*(.jcr)) }
160   .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
161   .dynamic        : { *(.dynamic) }
162   .got            : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
163   .data           :
164   {
165     __data_start = . ;
166     *(.data .data.* .gnu.linkonce.d.*)
167     SORT(CONSTRUCTORS)
168   }
169   .data1          : { *(.data1) }
170   _edata = .; PROVIDE (edata = .);
171   __bss_start = .;
172   __bss_start__ = .;
173   .bss            :
174   {
175    *(.dynbss)
176    *(.bss .bss.* .gnu.linkonce.b.*)
177    *(COMMON)
178    /* Align here to ensure that the .bss section occupies space up to
179       _end.  Align after .bss to ensure correct alignment even if the
180       .bss section disappears because there are no input sections.
181       FIXME: Why do we need it? When there is no .bss section, we don't
182       pad the .data section.  */
183    . = ALIGN(. != 0 ? 32 / 8 : 1);
184   }
185   _bss_end__ = . ; __bss_end__ = . ;
186   . = ALIGN(32 / 8);
187   . = ALIGN(32 / 8);
188   __end__ = . ;
189   _end = .; PROVIDE (end = .);
190   /* Stabs debugging sections.  */
191   .stab          0 : { *(.stab) }
192   .stabstr       0 : { *(.stabstr) }
193   .stab.excl     0 : { *(.stab.excl) }
194   .stab.exclstr  0 : { *(.stab.exclstr) }
195   .stab.index    0 : { *(.stab.index) }
196   .stab.indexstr 0 : { *(.stab.indexstr) }
197   .comment       0 : { *(.comment) }
198   /* DWARF debug sections.
199      Symbols in the DWARF debugging sections are relative to the beginning
200      of the section so we begin them at 0.  */
201   /* DWARF 1 */
202   .debug          0 : { *(.debug) }
203   .line           0 : { *(.line) }
204   /* GNU DWARF 1 extensions */
205   .debug_srcinfo  0 : { *(.debug_srcinfo .zdebug_srcinfo) }
206   .debug_sfnames  0 : { *(.debug_sfnames .zdebug_sfnames) }
207   /* DWARF 1.1 and DWARF 2 */
208   .debug_aranges  0 : { *(.debug_aranges .zdebug_aranges) }
209   .debug_pubnames 0 : { *(.debug_pubnames .zdebug_pubnames) }
210   /* DWARF 2 */
211   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.* .zdebug_info) }
212   .debug_abbrev   0 : { *(.debug_abbrev .zdebug_abbrev) }
213   .debug_line     0 : { *(.debug_line .zdebug_line) }
214   .debug_frame    0 : { *(.debug_frame .zdebug_frame) }
215   .debug_str      0 : { *(.debug_str .zdebug_str) }
216   .debug_loc      0 : { *(.debug_loc .zdebug_loc) }
217   .debug_macinfo  0 : { *(.debug_macinfo .zdebug_macinfo) }
218   /* SGI/MIPS DWARF 2 extensions */
219   .debug_weaknames 0 : { *(.debug_weaknames .zdebug_weaknames) }
220   .debug_funcnames 0 : { *(.debug_funcnames .zdebug_funcnames) }
221   .debug_typenames 0 : { *(.debug_typenames .zdebug_typenames) }
222   .debug_varnames  0 : { *(.debug_varnames .zdebug_varnames) }
223   /* DWARF 3 */
224   .debug_pubtypes 0 : { *(.debug_pubtypes .zdebug_pubtypes) }
225   .debug_ranges   0 : { *(.debug_ranges .zdebug_ranges) }
226     .stack         0x80000 :
227   {
228     _stack = .;
229     *(.stack)
230   }
231   .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }
232   .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
233   /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
234 }
235
236

UCC git Repository :: git.ucc.asn.au