Commit | Line | Data |
---|---|---|
229fcec5 MM |
1 | # This variant of elf.sc is used for ARM BPABI platforms, like Symbian |
2 | # OS, where a separate postlinker will operated on the generated | |
ba916c8a MM |
3 | # executable or shared object. See elf.sc for configuration variables |
4 | # that apply; only BPABI-specific variables will be noted here. | |
985743c7 | 5 | # |
219d1afa | 6 | # Copyright (C) 2014-2018 Free Software Foundation, Inc. |
6c19b93b | 7 | # |
985743c7 NC |
8 | # Copying and distribution of this file, with or without modification, |
9 | # are permitted in any medium without royalty provided the copyright | |
10 | # notice and this notice are preserved. | |
229fcec5 MM |
11 | |
12 | test -z "$ENTRY" && ENTRY=_start | |
13 | test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT} | |
14 | test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT} | |
15 | if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi | |
16 | test -z "${ELFSIZE}" && ELFSIZE=32 | |
17 | test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8" | |
18 | test "$LD_FLAG" = "N" && DATA_ADDR=. | |
19 | test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE="" | |
20 | test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE="" | |
21 | test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT | |
22 | DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))" | |
23 | DATA_SEGMENT_RELRO_END="" | |
24 | DATA_SEGMENT_RELRO_GOTPLT_END="" | |
25 | DATA_SEGMENT_END="" | |
26 | if test -n "${COMMONPAGESIZE}"; then | |
27 | DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})" | |
28 | DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);" | |
29 | if test -n "${SEPARATE_GOTPLT}"; then | |
30 | DATA_SEGMENT_RELRO_GOTPLT_END=". = DATA_SEGMENT_RELRO_END (. + ${SEPARATE_GOTPLT});" | |
31 | else | |
32 | DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (.);" | |
33 | fi | |
34 | fi | |
35 | INTERP=".interp 0 : { *(.interp) }" | |
ec2d9b29 AM |
36 | PLT=".plt ${RELOCATING-0} : { *(.plt) }" |
37 | RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" | |
18bbc1c5 | 38 | DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro .data.rel.ro.*) }" |
43e56c34 | 39 | DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" |
229fcec5 | 40 | if test -z "${NO_SMALL_DATA}"; then |
ec2d9b29 | 41 | SBSS=".sbss ${RELOCATING-0} : |
229fcec5 MM |
42 | { |
43 | ${RELOCATING+PROVIDE (__sbss_start = .);} | |
44 | ${RELOCATING+PROVIDE (___sbss_start = .);} | |
45 | *(.dynsbss) | |
46 | *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*}) | |
47 | *(.scommon) | |
48 | ${RELOCATING+PROVIDE (__sbss_end = .);} | |
49 | ${RELOCATING+PROVIDE (___sbss_end = .);} | |
50 | }" | |
ec2d9b29 | 51 | SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" |
229fcec5 MM |
52 | SDATA="/* We want the small data sections together, so single-instruction offsets |
53 | can access them all, and initialized data all before uninitialized, so | |
54 | we can shorten the on-disk segment size. */ | |
6c19b93b | 55 | .sdata ${RELOCATING-0} : |
229fcec5 MM |
56 | { |
57 | ${RELOCATING+${SDATA_START_SYMBOLS}} | |
58 | *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*}) | |
59 | }" | |
ec2d9b29 AM |
60 | SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }" |
61 | REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) } | |
62 | .rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }" | |
63 | REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) } | |
64 | .rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }" | |
65 | REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) } | |
66 | .rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }" | |
67 | REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) } | |
68 | .rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }" | |
229fcec5 MM |
69 | else |
70 | NO_SMALL_DATA=" " | |
71 | fi | |
72 | test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " | |
3cff7cc7 JZ |
73 | INIT_ARRAY=".init_array ${RELOCATING-0} : |
74 | { | |
75 | /* SymbianOS uses this symbol. */ | |
76 | ${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Base = .);} | |
77 | ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_start = .);}} | |
78 | KEEP (*(SORT(.init_array.*))) | |
79 | KEEP (*(.init_array)) | |
80 | ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_end = .);}} | |
81 | /* SymbianOS uses this symbol. */ | |
82 | ${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Limit = .);} | |
83 | }" | |
84 | FINI_ARRAY=".fini_array ${RELOCATING-0} : | |
85 | { | |
86 | ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_start = .);}} | |
87 | KEEP (*(SORT(.fini_array.*))) | |
88 | KEEP (*(.fini_array)) | |
89 | ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_end = .);}} | |
90 | }" | |
6c19b93b | 91 | CTOR=".ctors ${CONSTRUCTING-0} : |
229fcec5 MM |
92 | { |
93 | ${CONSTRUCTING+${CTOR_START}} | |
94 | /* gcc uses crtbegin.o to find the start of | |
95 | the constructors, so we make sure it is | |
96 | first. Because this is a wildcard, it | |
97 | doesn't matter if the user does not | |
98 | actually link against crtbegin.o; the | |
99 | linker won't look for a file to match a | |
100 | wildcard. The wildcard also means that it | |
101 | doesn't matter which directory crtbegin.o | |
102 | is in. */ | |
103 | ||
40cf2291 AM |
104 | KEEP (*crtbegin.o(.ctors)) |
105 | KEEP (*crtbegin?.o(.ctors)) | |
229fcec5 MM |
106 | |
107 | /* We don't want to include the .ctor section from | |
bd6791bc | 108 | the crtend.o file until after the sorted ctors. |
229fcec5 MM |
109 | The .ctor section from the crtend file contains the |
110 | end of ctors marker and it must be last */ | |
111 | ||
40cf2291 | 112 | KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors)) |
229fcec5 MM |
113 | KEEP (*(SORT(.ctors.*))) |
114 | KEEP (*(.ctors)) | |
115 | ${CONSTRUCTING+${CTOR_END}} | |
116 | }" | |
ec2d9b29 | 117 | DTOR=".dtors ${CONSTRUCTING-0} : |
229fcec5 MM |
118 | { |
119 | ${CONSTRUCTING+${DTOR_START}} | |
40cf2291 AM |
120 | KEEP (*crtbegin.o(.dtors)) |
121 | KEEP (*crtbegin?.o(.dtors)) | |
122 | KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors)) | |
229fcec5 MM |
123 | KEEP (*(SORT(.dtors.*))) |
124 | KEEP (*(.dtors)) | |
125 | ${CONSTRUCTING+${DTOR_END}} | |
126 | }" | |
ec2d9b29 | 127 | STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : |
229fcec5 MM |
128 | { |
129 | ${RELOCATING+_stack = .;} | |
130 | *(.stack) | |
131 | }" | |
132 | ||
ba916c8a MM |
133 | TEXT_START_ADDR="SEGMENT_START(\"text\", ${TEXT_START_ADDR})" |
134 | SHLIB_TEXT_START_ADDR="SEGMENT_START(\"text\", ${SHLIB_TEXT_START_ADDR:-0})" | |
135 | DATA_ADDR="SEGMENT_START(\"data\", ${DATA_ADDR-${DATA_SEGMENT_ALIGN}})" | |
136 | SHLIB_DATA_ADDR="SEGMENT_START(\"data\", ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}})" | |
137 | ||
985743c7 | 138 | # If this is for an embedded system, don't add SIZEOF_HEADERS. |
229fcec5 MM |
139 | if [ -z "$EMBEDDED" ]; then |
140 | test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS" | |
ba916c8a | 141 | SHLIB_BASE_ADDRESS="${SHLIB_TEXT_START_ADDR} + SIZEOF_HEADERS" |
229fcec5 MM |
142 | else |
143 | test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}" | |
ba916c8a | 144 | SHLIB_BASE_ADDRESS="${SHLIB_TEXT_START_ADDR}" |
229fcec5 MM |
145 | fi |
146 | ||
147 | cat <<EOF | |
219d1afa | 148 | /* Copyright (C) 2014-2018 Free Software Foundation, Inc. |
985743c7 NC |
149 | |
150 | Copying and distribution of this script, with or without modification, | |
151 | are permitted in any medium without royalty provided the copyright | |
152 | notice and this notice are preserved. */ | |
153 | ||
229fcec5 MM |
154 | OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", |
155 | "${LITTLE_OUTPUT_FORMAT}") | |
156 | OUTPUT_ARCH(${OUTPUT_ARCH}) | |
b34c1498 | 157 | ${RELOCATING+ENTRY(${ENTRY})} |
229fcec5 MM |
158 | |
159 | ${RELOCATING+${LIB_SEARCH_DIRS}} | |
160 | ${RELOCATING+/* Do we need any of these for elf? | |
161 | __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */} | |
162 | ${RELOCATING+${EXECUTABLE_SYMBOLS}} | |
163 | ${RELOCATING+${INPUT_FILES}} | |
ec2d9b29 AM |
164 | ${RELOCATING- /* For some reason, the Solaris linker makes bad executables |
165 | if gld -r is used and the intermediate file has sections starting | |
166 | at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld | |
167 | bug. But for now assigning the zero vmas works. */} | |
229fcec5 | 168 | |
6c19b93b | 169 | /* ARM's proprietary toolchain generate these symbols to match the start |
4e5db43b | 170 | and end of particular sections of the image. SymbianOS uses these |
6c19b93b AM |
171 | symbols. We provide them for compatibility with ARM's toolchains. |
172 | These symbols should be bound locally; each shared object may define | |
173 | its own version of these symbols. */ | |
174 | ||
4e5db43b | 175 | VERSION |
6c19b93b | 176 | { |
c68dac40 PB |
177 | /* Give these a dummy version to work around linker lameness. |
178 | The name used shouldn't matter as these are all local symbols. */ | |
6c19b93b AM |
179 | __GNU { |
180 | local: | |
4e5db43b MM |
181 | Image\$\$ER_RO\$\$Base; |
182 | Image\$\$ER_RO\$\$Limit; | |
183 | SHT\$\$INIT_ARRAY\$\$Base; | |
184 | SHT\$\$INIT_ARRAY\$\$Limit; | |
6c19b93b | 185 | .ARM.exidx\$\$Base; |
4e5db43b MM |
186 | .ARM.exidx\$\$Limit; |
187 | }; | |
188 | } | |
189 | ||
229fcec5 MM |
190 | SECTIONS |
191 | { | |
192 | /* Read-only sections, merged into text segment: */ | |
dc4c9c19 | 193 | ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR});}}} |
4e5db43b | 194 | |
dc4c9c19 | 195 | ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+ . = ${TEXT_BASE_ADDRESS};}}} |
ba916c8a MM |
196 | ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_BASE_ADDRESS};}} |
197 | ${CREATE_PIE+${RELOCATING+. = ${SHLIB_BASE_ADDRESS};}} | |
4e5db43b MM |
198 | |
199 | /* Define Image\$\$ER_RO\$\$Base. */ | |
200 | ${RELOCATING+PROVIDE (Image\$\$ER_RO\$\$Base = .);} | |
201 | ||
229fcec5 | 202 | ${INITIAL_READONLY_SECTIONS} |
229fcec5 MM |
203 | |
204 | EOF | |
229fcec5 | 205 | cat <<EOF |
6c19b93b AM |
206 | .init ${RELOCATING-0} : |
207 | { | |
229fcec5 MM |
208 | ${RELOCATING+${INIT_START}} |
209 | KEEP (*(.init)) | |
210 | ${RELOCATING+${INIT_END}} | |
211 | } =${NOP-0} | |
ec2d9b29 | 212 | .text ${RELOCATING-0} : |
229fcec5 MM |
213 | { |
214 | ${RELOCATING+${TEXT_START_SYMBOLS}} | |
215 | *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*}) | |
229fcec5 MM |
216 | /* .gnu.warning sections are handled specially by elf32.em. */ |
217 | *(.gnu.warning) | |
218 | ${RELOCATING+${OTHER_TEXT_SECTIONS}} | |
219 | } =${NOP-0} | |
ec2d9b29 | 220 | .fini ${RELOCATING-0} : |
229fcec5 MM |
221 | { |
222 | ${RELOCATING+${FINI_START}} | |
223 | KEEP (*(.fini)) | |
224 | ${RELOCATING+${FINI_END}} | |
225 | } =${NOP-0} | |
dc4c9c19 MM |
226 | /* The SymbianOS kernel requires that the PLT go at the end of the |
227 | text section. */ | |
228 | ${DATA_PLT-${BSS_PLT-${PLT}}} | |
229fcec5 MM |
229 | ${RELOCATING+PROVIDE (__etext = .);} |
230 | ${RELOCATING+PROVIDE (_etext = .);} | |
231 | ${RELOCATING+PROVIDE (etext = .);} | |
4e5db43b MM |
232 | |
233 | /* Define Image\$\$ER_RO\$\$Limit. */ | |
dc4c9c19 | 234 | ${RELOCATING+PROVIDE (Image\$\$ER_RO\$\$Limit = .);} |
4e5db43b | 235 | |
229fcec5 | 236 | ${WRITABLE_RODATA-${RODATA}} |
ec2d9b29 | 237 | .rodata1 ${RELOCATING-0} : { *(.rodata1) } |
229fcec5 MM |
238 | ${CREATE_SHLIB-${SDATA2}} |
239 | ${CREATE_SHLIB-${SBSS2}} | |
229fcec5 | 240 | |
dc4c9c19 MM |
241 | /* On SymbianOS, put .init_array and friends in the read-only |
242 | segment; there is no runtime relocation applied to these | |
243 | arrays. */ | |
229fcec5 | 244 | |
ec2d9b29 | 245 | .preinit_array ${RELOCATING-0} : |
6f2942ed PB |
246 | { |
247 | ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_start = .);}} | |
248 | KEEP (*(.preinit_array)) | |
249 | ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__preinit_array_end = .);}} | |
250 | } | |
3cff7cc7 JZ |
251 | ${RELOCATING+${INIT_ARRAY}} |
252 | ${RELOCATING+${FINI_ARRAY}} | |
229fcec5 | 253 | |
dc4c9c19 MM |
254 | ${OTHER_READONLY_SECTIONS} |
255 | .eh_frame_hdr : { *(.eh_frame_hdr) } | |
ec2d9b29 AM |
256 | .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } |
257 | .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } | |
dc4c9c19 MM |
258 | |
259 | /* Adjust the address for the data segment. We want to adjust up to | |
260 | the same address within the page on the next page up. */ | |
261 | ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR};}}} | |
262 | ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR};}} | |
263 | ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR};}} | |
264 | ||
265 | /* Exception handling */ | |
ec2d9b29 AM |
266 | .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } |
267 | .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } | |
dc4c9c19 MM |
268 | |
269 | /* Thread Local Storage sections */ | |
ec2d9b29 AM |
270 | .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } |
271 | .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} } | |
dc4c9c19 | 272 | |
229fcec5 MM |
273 | ${RELOCATING+${CTOR}} |
274 | ${RELOCATING+${DTOR}} | |
ec2d9b29 | 275 | .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } |
229fcec5 MM |
276 | |
277 | ${RELOCATING+${DATARELRO}} | |
278 | ${OTHER_RELRO_SECTIONS} | |
279 | ${RELOCATING+${DATA_SEGMENT_RELRO_END}} | |
280 | ||
281 | ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}} | |
282 | ||
ec2d9b29 | 283 | .data ${RELOCATING-0} : |
229fcec5 MM |
284 | { |
285 | ${RELOCATING+${DATA_START_SYMBOLS}} | |
286 | *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*}) | |
229fcec5 MM |
287 | ${CONSTRUCTING+SORT(CONSTRUCTORS)} |
288 | } | |
ec2d9b29 | 289 | .data1 ${RELOCATING-0} : { *(.data1) } |
229fcec5 MM |
290 | ${WRITABLE_RODATA+${RODATA}} |
291 | ${OTHER_READWRITE_SECTIONS} | |
292 | ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}} | |
293 | ${CREATE_SHLIB+${SDATA2}} | |
294 | ${CREATE_SHLIB+${SBSS2}} | |
295 | ${SDATA} | |
296 | ${OTHER_SDATA_SECTIONS} | |
297 | ${RELOCATING+_edata = .;} | |
298 | ${RELOCATING+PROVIDE (edata = .);} | |
ba916c8a | 299 | ${RELOCATING+. = DEFINED(__bss_segment_start) ? __bss_segment_start : .;} |
229fcec5 MM |
300 | ${RELOCATING+__bss_start = .;} |
301 | ${RELOCATING+${OTHER_BSS_SYMBOLS}} | |
302 | ${SBSS} | |
303 | ${BSS_PLT+${PLT}} | |
ec2d9b29 | 304 | .bss ${RELOCATING-0} : |
229fcec5 MM |
305 | { |
306 | *(.dynbss) | |
307 | *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) | |
308 | *(COMMON) | |
309 | /* Align here to ensure that the .bss section occupies space up to | |
310 | _end. Align after .bss to ensure correct alignment even if the | |
311 | .bss section disappears because there are no input sections. */ | |
312 | ${RELOCATING+. = ALIGN(${ALIGNMENT});} | |
313 | } | |
827a1c67 | 314 | ${RELOCATING+${OTHER_BSS_END_SYMBOLS}} |
229fcec5 | 315 | ${RELOCATING+. = ALIGN(${ALIGNMENT});} |
9f4fb502 | 316 | ${RELOCATING+${OTHER_END_SYMBOLS}} |
827a1c67 | 317 | ${RELOCATING+_end = .;} |
229fcec5 MM |
318 | ${RELOCATING+PROVIDE (end = .);} |
319 | ${RELOCATING+${DATA_SEGMENT_END}} | |
74dc9032 | 320 | ${STACK_ADDR+${STACK}} |
229fcec5 MM |
321 | |
322 | /* These sections are not mapped under the BPABI. */ | |
323 | .dynamic 0 : { *(.dynamic) } | |
324 | .hash 0 : { *(.hash) } | |
325 | .dynsym 0 : { *(.dynsym) } | |
326 | .dynstr 0 : { *(.dynstr) } | |
c0042f5d MM |
327 | .gnu.version 0 : { *(.gnu.version) } |
328 | .gnu.version_d 0: { *(.gnu.version_d) } | |
329 | .gnu.version_r 0: { *(.gnu.version_r) } | |
229fcec5 MM |
330 | ${CREATE_SHLIB-${INTERP}} |
331 | ||
332 | /* Stabs debugging sections. */ | |
333 | .stab 0 : { *(.stab) } | |
334 | .stabstr 0 : { *(.stabstr) } | |
335 | .stab.excl 0 : { *(.stab.excl) } | |
336 | .stab.exclstr 0 : { *(.stab.exclstr) } | |
337 | .stab.index 0 : { *(.stab.index) } | |
338 | .stab.indexstr 0 : { *(.stab.indexstr) } | |
339 | ||
340 | .comment 0 : { *(.comment) } | |
ceb0a680 | 341 | EOF |
229fcec5 | 342 | |
d061dfac | 343 | . $srcdir/scripttempl/DWARF.sc |
2a995fc1 | 344 | |
ceb0a680 | 345 | cat <<EOF |
229fcec5 | 346 | ${OTHER_SECTIONS} |
827a1c67 | 347 | ${RELOCATING+${OTHER_SYMBOLS}} |
1c68693b | 348 | ${RELOCATING+${DISCARDED}} |
ba916c8a MM |
349 | EOF |
350 | ||
351 | # These relocations sections are part of the read-only segment in SVR4 | |
352 | # executables, but are not mapped in BPABI executables. | |
353 | if [ "x$COMBRELOC" = x ]; then | |
354 | COMBRELOCCAT=cat | |
355 | else | |
356 | COMBRELOCCAT="cat > $COMBRELOC" | |
357 | fi | |
358 | eval $COMBRELOCCAT <<EOF | |
359 | .rel.init 0 : { *(.rel.init) } | |
360 | .rela.init 0 : { *(.rela.init) } | |
361 | .rel.text 0 : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) } | |
362 | .rela.text 0 : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) } | |
363 | .rel.fini 0 : { *(.rel.fini) } | |
364 | .rela.fini 0 : { *(.rela.fini) } | |
365 | .rel.rodata 0 : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) } | |
366 | .rela.rodata 0 : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) } | |
367 | ${OTHER_READONLY_RELOC_SECTIONS} | |
18bbc1c5 CC |
368 | .rel.data.rel.ro 0 : { *(.rel.data.rel.ro${RELOCATING+ .rel.data.rel.ro.*}) } |
369 | .rela.data.rel.ro 0 : { *(.rela.data.rel.ro${RELOCATING+ .rela.data.rel.ro.*}) } | |
ba916c8a MM |
370 | .rel.data 0 : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) } |
371 | .rela.data 0 : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) } | |
372 | .rel.tdata 0 : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) } | |
373 | .rela.tdata 0 : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) } | |
374 | .rel.tbss 0 : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) } | |
375 | .rela.tbss 0 : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) } | |
376 | .rel.ctors 0 : { *(.rel.ctors) } | |
377 | .rela.ctors 0 : { *(.rela.ctors) } | |
378 | .rel.dtors 0 : { *(.rel.dtors) } | |
379 | .rela.dtors 0 : { *(.rela.dtors) } | |
380 | ${REL_SDATA} | |
381 | ${REL_SBSS} | |
382 | ${REL_SDATA2} | |
383 | ${REL_SBSS2} | |
384 | .rel.bss 0 : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) } | |
385 | .rela.bss 0 : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) } | |
2a2a7c94 JB |
386 | .rel.init_array 0 : { *(.rel.init_array) } |
387 | .rela.init_array 0 : { *(.rela.init_array) } | |
388 | .rel.fini_array 0 : { *(.rel.fini_array) } | |
389 | .rela.fini_array 0 : { *(.rela.fini_array) } | |
ba916c8a MM |
390 | EOF |
391 | if [ -n "$COMBRELOC" ]; then | |
392 | cat <<EOF | |
393 | .rel.dyn 0 : | |
394 | { | |
395 | EOF | |
6c19b93b | 396 | sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC |
ba916c8a MM |
397 | cat <<EOF |
398 | } | |
399 | .rela.dyn 0 : | |
400 | { | |
401 | EOF | |
6c19b93b | 402 | sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC |
ba916c8a MM |
403 | cat <<EOF |
404 | } | |
405 | EOF | |
406 | fi | |
407 | cat <<EOF | |
408 | .rel.plt 0 : { *(.rel.plt) } | |
409 | .rela.plt 0 : { *(.rela.plt) } | |
410 | ${OTHER_PLT_RELOC_SECTIONS} | |
2a2a7c94 JB |
411 | .rel.other 0 : { *(.rel.*) } |
412 | .rela.other 0 : { *(.rela.*) } | |
413 | .reli.other 0 : { *(.reli.*) } | |
229fcec5 MM |
414 | } |
415 | EOF |