OSDN Git Service

temp
[gengkapak/clang-GengKapak.git] / aarch64-linux-gnu / lib / ldscripts / armelf.xdc
1 /* Script for -pie -z combreloc */
2 /* Copyright (C) 2014-2023 Free Software Foundation, Inc.
3    Copying and distribution of this script, with or without modification,
4    are permitted in any medium without royalty provided the copyright
5    notice and this notice are preserved.  */
6 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
7               "elf32-littlearm")
8 OUTPUT_ARCH(arm)
9 ENTRY(_start)
10 SEARCH_DIR("/home/runner/work/tc-build/tc-build/install/aarch64-linux-gnu/lib");
11 SECTIONS
12 {
13   /* Read-only sections, merged into text segment: */
14   PROVIDE (__executable_start = SEGMENT_START("text-segment", 0)); . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
15   .interp         : { *(.interp) }
16   .note.gnu.build-id  : { *(.note.gnu.build-id) }
17   .hash           : { *(.hash) }
18   .gnu.hash       : { *(.gnu.hash) }
19   .dynsym         : { *(.dynsym) }
20   .dynstr         : { *(.dynstr) }
21   .gnu.version    : { *(.gnu.version) }
22   .gnu.version_d  : { *(.gnu.version_d) }
23   .gnu.version_r  : { *(.gnu.version_r) }
24   .rel.dyn        :
25     {
26       *(.rel.init)
27       *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
28       *(.rel.fini)
29       *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
30       *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
31       *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
32       *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
33       *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
34       *(.rel.ctors)
35       *(.rel.dtors)
36       *(.rel.got)
37       *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
38       *(.rel.iplt)
39     }
40   .rela.dyn       :
41     {
42       *(.rela.init)
43       *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
44       *(.rela.fini)
45       *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
46       *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
47       *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
48       *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
49       *(.rela.ctors)
50       *(.rela.dtors)
51       *(.rela.got)
52       *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
53       *(.rela.iplt)
54     }
55   .rel.plt        :
56     {
57       *(.rel.plt)
58     }
59   .rela.plt       :
60     {
61       *(.rela.plt)
62     }
63   .init           :
64   {
65     KEEP (*(SORT_NONE(.init)))
66   }
67   .plt            : { *(.plt) }
68   .iplt           : { *(.iplt) }
69   .text           :
70   {
71     *(.text.unlikely .text.*_unlikely .text.unlikely.*)
72     *(.text.exit .text.exit.*)
73     *(.text.startup .text.startup.*)
74     *(.text.hot .text.hot.*)
75     *(SORT(.text.sorted.*))
76     *(.text .stub .text.* .gnu.linkonce.t.*)
77     /* .gnu.warning sections are handled specially by elf.em.  */
78     *(.gnu.warning)
79     *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
80   }
81   .fini           :
82   {
83     KEEP (*(SORT_NONE(.fini)))
84   }
85   PROVIDE (__etext = .);
86   PROVIDE (_etext = .);
87   PROVIDE (etext = .);
88   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
89   .rodata1        : { *(.rodata1) }
90   .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) }
91   .ARM.exidx   :
92     {
93       PROVIDE_HIDDEN (__exidx_start = .);
94       *(.ARM.exidx* .gnu.linkonce.armexidx.*)
95       PROVIDE_HIDDEN (__exidx_end = .);
96     }
97   .eh_frame_hdr   : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
98   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
99   .sframe         : ONLY_IF_RO { *(.sframe) *(.sframe.*) }
100   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
101   .gnu_extab   : ONLY_IF_RO { *(.gnu_extab*) }
102   /* These sections are generated by the Sun/Oracle C++ compiler.  */
103   .exception_ranges   : ONLY_IF_RO { *(.exception_ranges*) }
104   /* Adjust the address for the data segment.  We want to adjust up to
105      the same address within the page on the next page up.  */
106   . = ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1));
107   /* Exception handling  */
108   .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
109   .sframe         : ONLY_IF_RW { *(.sframe) *(.sframe.*) }
110   .gnu_extab      : ONLY_IF_RW { *(.gnu_extab) }
111   .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
112   .exception_ranges   : ONLY_IF_RW { *(.exception_ranges*) }
113   /* Thread Local Storage sections  */
114   .tdata          :
115    {
116      PROVIDE_HIDDEN (__tdata_start = .);
117      *(.tdata .tdata.* .gnu.linkonce.td.*)
118    }
119   .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
120   .preinit_array    :
121   {
122     PROVIDE_HIDDEN (__preinit_array_start = .);
123     KEEP (*(.preinit_array))
124     PROVIDE_HIDDEN (__preinit_array_end = .);
125   }
126   .init_array    :
127   {
128     PROVIDE_HIDDEN (__init_array_start = .);
129     KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
130     KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
131     PROVIDE_HIDDEN (__init_array_end = .);
132   }
133   .fini_array    :
134   {
135     PROVIDE_HIDDEN (__fini_array_start = .);
136     KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
137     KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
138     PROVIDE_HIDDEN (__fini_array_end = .);
139   }
140   .ctors          :
141   {
142     /* gcc uses crtbegin.o to find the start of
143        the constructors, so we make sure it is
144        first.  Because this is a wildcard, it
145        doesn't matter if the user does not
146        actually link against crtbegin.o; the
147        linker won't look for a file to match a
148        wildcard.  The wildcard also means that it
149        doesn't matter which directory crtbegin.o
150        is in.  */
151     KEEP (*crtbegin.o(.ctors))
152     KEEP (*crtbegin?.o(.ctors))
153     /* We don't want to include the .ctor section from
154        the crtend.o file until after the sorted ctors.
155        The .ctor section from the crtend file contains the
156        end of ctors marker and it must be last */
157     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
158     KEEP (*(SORT(.ctors.*)))
159     KEEP (*(.ctors))
160   }
161   .dtors          :
162   {
163     KEEP (*crtbegin.o(.dtors))
164     KEEP (*crtbegin?.o(.dtors))
165     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
166     KEEP (*(SORT(.dtors.*)))
167     KEEP (*(.dtors))
168   }
169   .jcr            : { KEEP (*(.jcr)) }
170   .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
171   .dynamic        : { *(.dynamic) }
172   .got            : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
173   .data           :
174   {
175     __data_start = .;
176     *(.data .data.* .gnu.linkonce.d.*)
177     SORT(CONSTRUCTORS)
178   }
179   .data1          : { *(.data1) }
180   _edata = .; PROVIDE (edata = .);
181   /* This section contains data that is initialized during load,
182      but not during the application's initialization sequence.  */
183   .persistent :
184   {
185     . = ALIGN(32 / 8);
186     PROVIDE (__persistent_start = .);
187     *(.persistent .persistent.* .gnu.linkonce.p.*)
188     . = ALIGN(32 / 8);
189     PROVIDE (__persistent_end = .);
190   }
191   . = .;
192   __bss_start = .;
193   __bss_start__ = .;
194   .bss            :
195   {
196    *(.dynbss)
197    *(.bss .bss.* .gnu.linkonce.b.*)
198    *(COMMON)
199    /* Align here to ensure that the .bss section occupies space up to
200       _end.  Align after .bss to ensure correct alignment even if the
201       .bss section disappears because there are no input sections.
202       FIXME: Why do we need it? When there is no .bss section, we do not
203       pad the .data section.  */
204    . = ALIGN(. != 0 ? 32 / 8 : 1);
205   }
206   _bss_end__ = .; __bss_end__ = .;
207   /* This section contains data that is not initialized during load,
208      or during the application's initialization sequence.  */
209   .noinit (NOLOAD) :
210   {
211     . = ALIGN(32 / 8);
212     PROVIDE (__noinit_start = .);
213     *(.noinit .noinit.* .gnu.linkonce.n.*)
214     . = ALIGN(32 / 8);
215     PROVIDE (__noinit_end = .);
216   }
217   . = ALIGN(32 / 8);
218   . = SEGMENT_START("ldata-segment", .);
219   . = ALIGN(32 / 8);
220   __end__ = .;
221   _end = .; PROVIDE (end = .);
222   .stack         0x80000 :
223   {
224     _stack = .;
225     *(.stack)
226   }
227   /* Stabs debugging sections.  */
228   .stab          0 : { *(.stab) }
229   .stabstr       0 : { *(.stabstr) }
230   .stab.excl     0 : { *(.stab.excl) }
231   .stab.exclstr  0 : { *(.stab.exclstr) }
232   .stab.index    0 : { *(.stab.index) }
233   .stab.indexstr 0 : { *(.stab.indexstr) }
234   .comment       0 : { *(.comment) }
235   .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
236   /* DWARF debug sections.
237      Symbols in the DWARF debugging sections are relative to the beginning
238      of the section so we begin them at 0.  */
239   /* DWARF 1.  */
240   .debug          0 : { *(.debug) }
241   .line           0 : { *(.line) }
242   /* GNU DWARF 1 extensions.  */
243   .debug_srcinfo  0 : { *(.debug_srcinfo) }
244   .debug_sfnames  0 : { *(.debug_sfnames) }
245   /* DWARF 1.1 and DWARF 2.  */
246   .debug_aranges  0 : { *(.debug_aranges) }
247   .debug_pubnames 0 : { *(.debug_pubnames) }
248   /* DWARF 2.  */
249   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
250   .debug_abbrev   0 : { *(.debug_abbrev) }
251   .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end) }
252   .debug_frame    0 : { *(.debug_frame) }
253   .debug_str      0 : { *(.debug_str) }
254   .debug_loc      0 : { *(.debug_loc) }
255   .debug_macinfo  0 : { *(.debug_macinfo) }
256   /* SGI/MIPS DWARF 2 extensions.  */
257   .debug_weaknames 0 : { *(.debug_weaknames) }
258   .debug_funcnames 0 : { *(.debug_funcnames) }
259   .debug_typenames 0 : { *(.debug_typenames) }
260   .debug_varnames  0 : { *(.debug_varnames) }
261   /* DWARF 3.  */
262   .debug_pubtypes 0 : { *(.debug_pubtypes) }
263   .debug_ranges   0 : { *(.debug_ranges) }
264   /* DWARF 5.  */
265   .debug_addr     0 : { *(.debug_addr) }
266   .debug_line_str 0 : { *(.debug_line_str) }
267   .debug_loclists 0 : { *(.debug_loclists) }
268   .debug_macro    0 : { *(.debug_macro) }
269   .debug_names    0 : { *(.debug_names) }
270   .debug_rnglists 0 : { *(.debug_rnglists) }
271   .debug_str_offsets 0 : { *(.debug_str_offsets) }
272   .debug_sup      0 : { *(.debug_sup) }
273   .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }
274   .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
275   /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
276 }