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