blob: 1da01328c23822aada979c5c3453606eae7ce7f2 [file] [log] [blame]
xf.libdd93d52023-05-12 07:10:14 -07001/* Script for --shared -z combreloc: shared library, combine & sort relocs */
2/* Copyright (C) 2014-2017 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. */
6OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
7 "elf32-littlearm")
8OUTPUT_ARCH(arm)
9ENTRY(_start)
10SEARCH_DIR("=/public/work/v3t/br/v3e_32m/buildroot-2015.08.1/output/host/usr/arm-buildroot-linux-gnueabi/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
11SECTIONS
12{
13 /* Read-only sections, merged into text segment: */
14 . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
15 .note.gnu.build-id : { *(.note.gnu.build-id) }
16 .note.ABI-tag : { *(.note.ABI-tag) } .gnu.hash : { *(.gnu.hash) }
17 .dynsym : { *(.dynsym) }
18 .dynstr : { *(.dynstr) }
19 .gnu.version : { *(.gnu.version) }
20 .gnu.version_d : { *(.gnu.version_d) }
21 .gnu.version_r : { *(.gnu.version_r) }
22 .rel.dyn :
23 {
24 *(.rel.init)
25 *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
26 *(.rel.fini)
27 *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
28 *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
29 *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
30 *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
31 *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
32 *(.rel.ctors)
33 *(.rel.dtors)
34 *(.rel.got)
35 *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
36 *(.rel.iplt)
37 }
38 .rela.dyn :
39 {
40 *(.rela.init)
41 *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
42 *(.rela.fini)
43 *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
44 *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
45 *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
46 *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
47 *(.rela.ctors)
48 *(.rela.dtors)
49 *(.rela.got)
50 *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
51 *(.rela.iplt)
52 }
53 .rel.plt :
54 {
55 *(.rel.plt)
56 }
57 .rela.plt :
58 {
59 *(.rela.plt)
60 }
61 .init :
62 {
63 KEEP (*(SORT_NONE(.init)))
64 }
65 .plt : { *(.plt) }
66 .iplt : { *(.iplt) }
67 .text :
68 {
69 *(.text.unlikely .text.*_unlikely .text.unlikely.*)
70 *(.text.exit .text.exit.*)
71 *(.text.startup .text.startup.*)
72 *(.text.hot .text.hot.*)
73 *(.text .stub .text.* .gnu.linkonce.t.*)
74 /* .gnu.warning sections are handled specially by elf32.em. */
75 *(.gnu.warning)
76 *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
77 }
78 .fini :
79 {
80 KEEP (*(SORT_NONE(.fini)))
81 }
82 PROVIDE (__etext = .);
83 PROVIDE (_etext = .);
84 PROVIDE (etext = .);
85 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
86 .rodata1 : { *(.rodata1) }
87 .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) }
88 PROVIDE_HIDDEN (__exidx_start = .);
89 .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
90 PROVIDE_HIDDEN (__exidx_end = .);
91 .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
92 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
93 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
94 .gcc_except_table.*) }
95 .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) }
96 /* These sections are generated by the Sun/Oracle C++ compiler. */
97 .exception_ranges : ONLY_IF_RO { *(.exception_ranges
98 .exception_ranges*) }
99 /* Adjust the address for the data segment. We want to adjust up to
100 the same address within the page on the next page up. */
101 .hash : { *(.hash) }
102 . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
103 /* Exception handling */
104 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
105 .gnu_extab : ONLY_IF_RW { *(.gnu_extab) }
106 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
107 .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
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 KEEP (*(.preinit_array))
114 }
115 .init_array :
116 {
117 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
118 KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
119 }
120 .fini_array :
121 {
122 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
123 KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
124 }
125 .ctors :
126 {
127 /* gcc uses crtbegin.o to find the start of
128 the constructors, so we make sure it is
129 first. Because this is a wildcard, it
130 doesn't matter if the user does not
131 actually link against crtbegin.o; the
132 linker won't look for a file to match a
133 wildcard. The wildcard also means that it
134 doesn't matter which directory crtbegin.o
135 is in. */
136 KEEP (*crtbegin.o(.ctors))
137 KEEP (*crtbegin?.o(.ctors))
138 /* We don't want to include the .ctor section from
139 the crtend.o file until after the sorted ctors.
140 The .ctor section from the crtend file contains the
141 end of ctors marker and it must be last */
142 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
143 KEEP (*(SORT(.ctors.*)))
144 KEEP (*(.ctors))
145 }
146 .dtors :
147 {
148 KEEP (*crtbegin.o(.dtors))
149 KEEP (*crtbegin?.o(.dtors))
150 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
151 KEEP (*(SORT(.dtors.*)))
152 KEEP (*(.dtors))
153 }
154 .jcr : { KEEP (*(.jcr)) }
155 PROVIDE(__start___libc_subfreeres = .);
156 __libc_subfreeres : { *(__libc_subfreeres) }
157 PROVIDE(__stop___libc_subfreeres = .);
158 PROVIDE(__start___libc_atexit = .);
159 __libc_atexit : { *(__libc_atexit) }
160 PROVIDE(__stop___libc_atexit = .);
161 PROVIDE(__start___libc_thread_subfreeres = .);
162 __libc_thread_subfreeres : { *(__libc_thread_subfreeres) }
163 PROVIDE(__stop___libc_thread_subfreeres = .);
164 /DISCARD/ : { *(.gnu.glibc-stub.*) }
165 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
166 .dynamic : { *(.dynamic) }
167 . = DATA_SEGMENT_RELRO_END (0, .);
168 .got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
169 .data :
170 {
171 PROVIDE (__data_start = .);
172 *(.data .data.* .gnu.linkonce.d.*)
173 SORT(CONSTRUCTORS)
174 }
175 .data1 : { *(.data1) }
176 _edata = .; PROVIDE (edata = .);
177 . = .;
178 __bss_start = .;
179 __bss_start__ = .;
180 .bss :
181 {
182 *(.dynbss)
183 PROVIDE(__start___libc_freeres_ptrs = .);
184 *(__libc_freeres_ptrs)
185 PROVIDE(__stop___libc_freeres_ptrs = .);
186 *(.bss .bss.* .gnu.linkonce.b.*)
187 *(COMMON)
188 /* Align here to ensure that the .bss section occupies space up to
189 _end. Align after .bss to ensure correct alignment even if the
190 .bss section disappears because there are no input sections.
191 FIXME: Why do we need it? When there is no .bss section, we don't
192 pad the .data section. */
193 . = ALIGN(. != 0 ? 32 / 8 : 1);
194 }
195 _bss_end__ = . ; __bss_end__ = . ;
196 . = ALIGN(32 / 8);
197 . = SEGMENT_START("ldata-segment", .);
198 . = ALIGN(32 / 8);
199 __end__ = . ;
200 _end = .; PROVIDE (end = .);
201 . = DATA_SEGMENT_END (.);
202 /* Stabs debugging sections. */
203 .stab 0 : { *(.stab) }
204 .stabstr 0 : { *(.stabstr) }
205 .stab.excl 0 : { *(.stab.excl) }
206 .stab.exclstr 0 : { *(.stab.exclstr) }
207 .stab.index 0 : { *(.stab.index) }
208 .stab.indexstr 0 : { *(.stab.indexstr) }
209 .comment 0 : { *(.comment) }
210 /* DWARF debug sections.
211 Symbols in the DWARF debugging sections are relative to the beginning
212 of the section so we begin them at 0. */
213 /* DWARF 1 */
214 .debug 0 : { *(.debug) }
215 .line 0 : { *(.line) }
216 /* GNU DWARF 1 extensions */
217 .debug_srcinfo 0 : { *(.debug_srcinfo) }
218 .debug_sfnames 0 : { *(.debug_sfnames) }
219 /* DWARF 1.1 and DWARF 2 */
220 .debug_aranges 0 : { *(.debug_aranges) }
221 .debug_pubnames 0 : { *(.debug_pubnames) }
222 /* DWARF 2 */
223 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
224 .debug_abbrev 0 : { *(.debug_abbrev) }
225 .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
226 .debug_frame 0 : { *(.debug_frame) }
227 .debug_str 0 : { *(.debug_str) }
228 .debug_loc 0 : { *(.debug_loc) }
229 .debug_macinfo 0 : { *(.debug_macinfo) }
230 /* SGI/MIPS DWARF 2 extensions */
231 .debug_weaknames 0 : { *(.debug_weaknames) }
232 .debug_funcnames 0 : { *(.debug_funcnames) }
233 .debug_typenames 0 : { *(.debug_typenames) }
234 .debug_varnames 0 : { *(.debug_varnames) }
235 /* DWARF 3 */
236 .debug_pubtypes 0 : { *(.debug_pubtypes) }
237 .debug_ranges 0 : { *(.debug_ranges) }
238 /* DWARF Extension. */
239 .debug_macro 0 : { *(.debug_macro) }
240 .debug_addr 0 : { *(.debug_addr) }
241 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
242 .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
243 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
244}
245
246