* ldgram.y: Add SPECIAL token.
[binutils.git] / ld / scripttempl / elf.sc
blob3e0f0b05dd81cc6baa821a6f416a1e0f4c92d44b
2 # Unusual variables checked by this code:
3 #       NOP - four byte opcode for no-op (defaults to 0)
4 #       NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
5 #               empty.
6 #       SMALL_DATA_CTOR - .ctors contains small data.
7 #       SMALL_DATA_DTOR - .dtors contains small data.
8 #       DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
9 #       INITIAL_READONLY_SECTIONS - at start of text segment
10 #       OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
11 #               (e.g., .PARISC.milli)
12 #       OTHER_TEXT_SECTIONS - these get put in .text when relocating
13 #       OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
14 #               (e.g., .PARISC.global)
15 #       OTHER_RELRO_SECTIONS - other than .data.rel.ro ...
16 #               (e.g. PPC32 .fixup, .got[12])
17 #       OTHER_BSS_SECTIONS - other than .bss .sbss ...
18 #       OTHER_SECTIONS - at the end
19 #       EXECUTABLE_SYMBOLS - symbols that must be defined for an
20 #               executable (e.g., _DYNAMIC_LINK)
21 #       TEXT_START_ADDR - the first byte of the text segment, after any
22 #               headers.
23 #       TEXT_BASE_ADDRESS - the first byte of the text segment.
24 #       TEXT_START_SYMBOLS - symbols that appear at the start of the
25 #               .text section.
26 #       DATA_START_SYMBOLS - symbols that appear at the start of the
27 #               .data section.
28 #       DATA_END_SYMBOLS - symbols that appear at the end of the
29 #               writeable data sections.
30 #       OTHER_GOT_SYMBOLS - symbols defined just before .got.
31 #       OTHER_GOT_SECTIONS - sections just after .got.
32 #       OTHER_SDATA_SECTIONS - sections just after .sdata.
33 #       OTHER_BSS_SYMBOLS - symbols that appear at the start of the
34 #               .bss section besides __bss_start.
35 #       DATA_PLT - .plt should be in data segment, not text segment.
36 #       PLT_BEFORE_GOT - .plt just before .got when .plt is in data segement.
37 #       BSS_PLT - .plt should be in bss segment
38 #       TEXT_DYNAMIC - .dynamic in text segment, not data segment.
39 #       EMBEDDED - whether this is for an embedded system. 
40 #       SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
41 #               start address of shared library.
42 #       INPUT_FILES - INPUT command of files to always include
43 #       WRITABLE_RODATA - if set, the .rodata section should be writable
44 #       INIT_START, INIT_END -  statements just before and just after
45 #       combination of .init sections.
46 #       FINI_START, FINI_END - statements just before and just after
47 #       combination of .fini sections.
48 #       STACK_ADDR - start of a .stack section.
49 #       OTHER_END_SYMBOLS - symbols to place right at the end of the script.
50 #       ETEXT_NAME - name of a symbol for the end of the text section,
51 #               normally etext.
52 #       SEPARATE_GOTPLT - if set, .got.plt should be separate output section,
53 #               so that .got can be in the RELRO area.  It should be set to
54 #               the number of bytes in the beginning of .got.plt which can be
55 #               in the RELRO area as well.
57 # When adding sections, do note that the names of some sections are used
58 # when specifying the start address of the next.
61 #  Many sections come in three flavours.  There is the 'real' section,
62 #  like ".data".  Then there are the per-procedure or per-variable
63 #  sections, generated by -ffunction-sections and -fdata-sections in GCC,
64 #  and useful for --gc-sections, which for a variable "foo" might be
65 #  ".data.foo".  Then there are the linkonce sections, for which the linker
66 #  eliminates duplicates, which are named like ".gnu.linkonce.d.foo".
67 #  The exact correspondences are:
69 #  Section      Linkonce section
70 #  .text        .gnu.linkonce.t.foo
71 #  .rodata      .gnu.linkonce.r.foo
72 #  .data        .gnu.linkonce.d.foo
73 #  .bss         .gnu.linkonce.b.foo
74 #  .sdata       .gnu.linkonce.s.foo
75 #  .sbss        .gnu.linkonce.sb.foo
76 #  .sdata2      .gnu.linkonce.s2.foo
77 #  .sbss2       .gnu.linkonce.sb2.foo
78 #  .debug_info  .gnu.linkonce.wi.foo
79 #  .tdata       .gnu.linkonce.td.foo
80 #  .tbss        .gnu.linkonce.tb.foo
82 #  Each of these can also have corresponding .rel.* and .rela.* sections.
84 test -z "$ENTRY" && ENTRY=_start
85 test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
86 test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
87 if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
88 test -z "${ELFSIZE}" && ELFSIZE=32
89 test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
90 test "$LD_FLAG" = "N" && DATA_ADDR=.
91 test -z "${ETEXT_NAME}" && ETEXT_NAME=etext
92 test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
93 test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
94 test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT
95 DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
96 DATA_SEGMENT_RELRO_END=""
97 DATA_SEGMENT_END=""
98 if test -n "${COMMONPAGESIZE}"; then
99   DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
100   DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
101   DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
103 INTERP=".interp       ${RELOCATING-0} : { *(.interp) }"
104 if test -z "$PLT"; then
105   PLT=".plt          ${RELOCATING-0} : { *(.plt) }"
107 if test -z "$GOT"; then
108   if test -z "$SEPARATE_GOTPLT"; then
109     GOT=".got          ${RELOCATING-0} : { *(.got.plt) *(.got) }"
110   else
111     GOT=".got          ${RELOCATING-0} : { *(.got) }"
112     GOTPLT=".got.plt      ${RELOCATING-0} : { *(.got.plt) }"
113   fi
115 DYNAMIC=".dynamic      ${RELOCATING-0} : { *(.dynamic) }"
116 RODATA=".rodata       ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
117 DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }"
118 STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
119 if test -z "${NO_SMALL_DATA}"; then
120   SBSS=".sbss         ${RELOCATING-0} :
121   {
122     ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
123     *(.dynsbss)
124     *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
125     *(.scommon)
126   }"
127   SBSS2=".sbss2        ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
128   SDATA="/* We want the small data sections together, so single-instruction offsets
129      can access them all, and initialized data all before uninitialized, so
130      we can shorten the on-disk segment size.  */
131   .sdata        ${RELOCATING-0} : 
132   {
133     ${RELOCATING+${SDATA_START_SYMBOLS}}
134     ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
135     *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
136   }"
137   SDATA2=".sdata2       ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
138   REL_SDATA=".rel.sdata    ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
139   .rela.sdata   ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
140   REL_SBSS=".rel.sbss     ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
141   .rela.sbss    ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
142   REL_SDATA2=".rel.sdata2   ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
143   .rela.sdata2  ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
144   REL_SBSS2=".rel.sbss2    ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
145   .rela.sbss2   ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
146 else
147   NO_SMALL_DATA=" "
149 if test -z "${DATA_GOT}"; then
150   if test -n "${NO_SMALL_DATA}"; then
151     DATA_GOT=" "
152   fi
154 if test -z "${SDATA_GOT}"; then
155   if test -z "${NO_SMALL_DATA}"; then
156     SDATA_GOT=" "
157   fi
159 test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
160 CTOR=".ctors        ${CONSTRUCTING-0} : 
161   {
162     ${CONSTRUCTING+${CTOR_START}}
163     /* gcc uses crtbegin.o to find the start of
164        the constructors, so we make sure it is
165        first.  Because this is a wildcard, it
166        doesn't matter if the user does not
167        actually link against crtbegin.o; the
168        linker won't look for a file to match a
169        wildcard.  The wildcard also means that it
170        doesn't matter which directory crtbegin.o
171        is in.  */
173     KEEP (*crtbegin*.o(.ctors))
175     /* We don't want to include the .ctor section from
176        from the crtend.o file until after the sorted ctors.
177        The .ctor section from the crtend file contains the
178        end of ctors marker and it must be last */
180     KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
181     KEEP (*(SORT(.ctors.*)))
182     KEEP (*(.ctors))
183     ${CONSTRUCTING+${CTOR_END}}
184   }"
185 DTOR=".dtors        ${CONSTRUCTING-0} :
186   {
187     ${CONSTRUCTING+${DTOR_START}}
188     KEEP (*crtbegin*.o(.dtors))
189     KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
190     KEEP (*(SORT(.dtors.*)))
191     KEEP (*(.dtors))
192     ${CONSTRUCTING+${DTOR_END}}
193   }"
194 STACK="  .stack        ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
195   {
196     ${RELOCATING+_stack = .;}
197     *(.stack)
198   }"
200 # if this is for an embedded system, don't add SIZEOF_HEADERS.
201 if [ -z "$EMBEDDED" ]; then
202    test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS"
203 else
204    test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
207 cat <<EOF
208 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
209               "${LITTLE_OUTPUT_FORMAT}")
210 OUTPUT_ARCH(${OUTPUT_ARCH})
211 ENTRY(${ENTRY})
213 ${RELOCATING+${LIB_SEARCH_DIRS}}
214 ${RELOCATING+/* Do we need any of these for elf?
215    __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}}  */}
216 ${RELOCATING+${EXECUTABLE_SYMBOLS}}
217 ${RELOCATING+${INPUT_FILES}}
218 ${RELOCATING- /* For some reason, the Solaris linker makes bad executables
219   if gld -r is used and the intermediate file has sections starting
220   at non-zero addresses.  Could be a Solaris ld bug, could be a GNU ld
221   bug.  But for now assigning the zero vmas works.  */}
223 SECTIONS
225   /* Read-only sections, merged into text segment: */
226   ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
227   ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
228   ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
229   ${CREATE_SHLIB-${INTERP}}
230   ${INITIAL_READONLY_SECTIONS}
231   ${TEXT_DYNAMIC+${DYNAMIC}}
232   .hash         ${RELOCATING-0} : { *(.hash) }
233   .dynsym       ${RELOCATING-0} : { *(.dynsym) }
234   .dynstr       ${RELOCATING-0} : { *(.dynstr) }
235   .gnu.version  ${RELOCATING-0} : { *(.gnu.version) }
236   .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) }
237   .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) }
240 if [ "x$COMBRELOC" = x ]; then
241   COMBRELOCCAT=cat
242 else
243   COMBRELOCCAT="cat > $COMBRELOC"
245 eval $COMBRELOCCAT <<EOF
246   .rel.init     ${RELOCATING-0} : { *(.rel.init) }
247   .rela.init    ${RELOCATING-0} : { *(.rela.init) }
248   .rel.text     ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
249   .rela.text    ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
250   .rel.fini     ${RELOCATING-0} : { *(.rel.fini) }
251   .rela.fini    ${RELOCATING-0} : { *(.rela.fini) }
252   .rel.rodata   ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
253   .rela.rodata  ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
254   ${OTHER_READONLY_RELOC_SECTIONS}
255   .rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+*}) }
256   .rela.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+*}) }
257   .rel.data     ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
258   .rela.data    ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
259   .rel.tdata    ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
260   .rela.tdata   ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
261   .rel.tbss     ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
262   .rela.tbss    ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
263   .rel.ctors    ${RELOCATING-0} : { *(.rel.ctors) }
264   .rela.ctors   ${RELOCATING-0} : { *(.rela.ctors) }
265   .rel.dtors    ${RELOCATING-0} : { *(.rel.dtors) }
266   .rela.dtors   ${RELOCATING-0} : { *(.rela.dtors) }
267   .rel.got      ${RELOCATING-0} : { *(.rel.got) }
268   .rela.got     ${RELOCATING-0} : { *(.rela.got) }
269   ${OTHER_GOT_RELOC_SECTIONS}
270   ${REL_SDATA}
271   ${REL_SBSS}
272   ${REL_SDATA2}
273   ${REL_SBSS2}
274   .rel.bss      ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
275   .rela.bss     ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
277 if [ -n "$COMBRELOC" ]; then
278 cat <<EOF
279   .rel.dyn      ${RELOCATING-0} :
280     {
282 sed -e '/^[     ]*[{}][         ]*$/d;/:[       ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/      \1/' $COMBRELOC
283 cat <<EOF
284     }
285   .rela.dyn     ${RELOCATING-0} :
286     {
288 sed -e '/^[     ]*[{}][         ]*$/d;/:[       ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/      \1/' $COMBRELOC
289 cat <<EOF
290     }
293 cat <<EOF
294   .rel.plt      ${RELOCATING-0} : { *(.rel.plt) }
295   .rela.plt     ${RELOCATING-0} : { *(.rela.plt) }
296   ${OTHER_PLT_RELOC_SECTIONS}
298   .init         ${RELOCATING-0} : 
299   { 
300     ${RELOCATING+${INIT_START}}
301     KEEP (*(.init))
302     ${RELOCATING+${INIT_END}}
303   } =${NOP-0}
305   ${DATA_PLT-${BSS_PLT-${PLT}}}
306   .text         ${RELOCATING-0} :
307   {
308     ${RELOCATING+${TEXT_START_SYMBOLS}}
309     *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
310     KEEP (*(.text.*personality*))
311     /* .gnu.warning sections are handled specially by elf32.em.  */
312     *(.gnu.warning)
313     ${RELOCATING+${OTHER_TEXT_SECTIONS}}
314   } =${NOP-0}
315   .fini         ${RELOCATING-0} :
316   {
317     ${RELOCATING+${FINI_START}}
318     KEEP (*(.fini))
319     ${RELOCATING+${FINI_END}}
320   } =${NOP-0}
321   ${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);}
322   ${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
323   ${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}
324   ${WRITABLE_RODATA-${RODATA}}
325   .rodata1      ${RELOCATING-0} : { *(.rodata1) }
326   ${CREATE_SHLIB-${SDATA2}}
327   ${CREATE_SHLIB-${SBSS2}}
328   ${OTHER_READONLY_SECTIONS}
329   .eh_frame_hdr : { *(.eh_frame_hdr) }
330   .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
331   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
333   /* Adjust the address for the data segment.  We want to adjust up to
334      the same address within the page on the next page up.  */
335   ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
336   ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
337   ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
339   /* Exception handling  */
340   .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
341   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
343   /* Thread Local Storage sections  */
344   .tdata        ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
345   .tbss         ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
347   .preinit_array   ${RELOCATING-0} : { KEEP (*(.preinit_array)) }
348   .init_array   ${RELOCATING-0} : { KEEP (*(.init_array)) }
349   .fini_array   ${RELOCATING-0} : { KEEP (*(.fini_array)) }
351   ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
352   ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
353   .jcr          ${RELOCATING-0} : { KEEP (*(.jcr)) }
355   ${RELOCATING+${DATARELRO}}
356   ${OTHER_RELRO_SECTIONS}
357   ${TEXT_DYNAMIC-${DYNAMIC}}
358   ${DATA_GOT+${RELRO_NOW+${GOT}}}
359   ${DATA_GOT+${RELRO_NOW+${GOTPLT}}}
360   ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
361   ${RELOCATING+${DATA_SEGMENT_RELRO_END}}
362   ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
363   ${DATA_GOT+${RELRO_NOW-${GOTPLT}}}
365   ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
367   .data         ${RELOCATING-0} :
368   {
369     ${RELOCATING+${DATA_START_SYMBOLS}}
370     *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
371     KEEP (*(.gnu.linkonce.d.*personality*))
372     ${CONSTRUCTING+SORT(CONSTRUCTORS)}
373   }
374   .data1        ${RELOCATING-0} : { *(.data1) }
375   ${WRITABLE_RODATA+${RODATA}}
376   ${OTHER_READWRITE_SECTIONS}
377   ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
378   ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
379   ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
380   ${SDATA_GOT+${RELOCATING+${OTHER_GOT_SYMBOLS}}}
381   ${SDATA_GOT+${GOT}}
382   ${SDATA_GOT+${OTHER_GOT_SECTIONS}}
383   ${SDATA}
384   ${OTHER_SDATA_SECTIONS}
385   ${RELOCATING+${DATA_END_SYMBOLS-_edata = .; PROVIDE (edata = .);}}
386   /* __bss_start is used by _bfd_elf_provide_section_bound_symbols in
387      elflink.c.  */
388   ${RELOCATING+__bss_start = .;}
389   ${RELOCATING+${OTHER_BSS_SYMBOLS}}
390   ${SBSS}
391   ${BSS_PLT+${PLT}}
392   .bss          ${RELOCATING-0} :
393   {
394    *(.dynbss)
395    *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
396    *(COMMON)
397    /* Align here to ensure that the .bss section occupies space up to
398       _end.  Align after .bss to ensure correct alignment even if the
399       .bss section disappears because there are no input sections.  */
400    ${RELOCATING+. = ALIGN(${ALIGNMENT});}
401   }
402   ${OTHER_BSS_SECTIONS}
403   ${RELOCATING+. = ALIGN(${ALIGNMENT});}
404   ${RELOCATING+_end = .;}
405   ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
406   ${RELOCATING+PROVIDE (end = .);}
407   ${RELOCATING+${DATA_SEGMENT_END}}
409   /* Stabs debugging sections.  */
410   .stab          0 : { *(.stab) }
411   .stabstr       0 : { *(.stabstr) }
412   .stab.excl     0 : { *(.stab.excl) }
413   .stab.exclstr  0 : { *(.stab.exclstr) }
414   .stab.index    0 : { *(.stab.index) }
415   .stab.indexstr 0 : { *(.stab.indexstr) }
417   .comment       0 : { *(.comment) }
419   /* DWARF debug sections.
420      Symbols in the DWARF debugging sections are relative to the beginning
421      of the section so we begin them at 0.  */
423   /* DWARF 1 */
424   .debug          0 : { *(.debug) }
425   .line           0 : { *(.line) }
427   /* GNU DWARF 1 extensions */
428   .debug_srcinfo  0 : { *(.debug_srcinfo) }
429   .debug_sfnames  0 : { *(.debug_sfnames) }
431   /* DWARF 1.1 and DWARF 2 */
432   .debug_aranges  0 : { *(.debug_aranges) }
433   .debug_pubnames 0 : { *(.debug_pubnames) }
435   /* DWARF 2 */
436   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
437   .debug_abbrev   0 : { *(.debug_abbrev) }
438   .debug_line     0 : { *(.debug_line) }
439   .debug_frame    0 : { *(.debug_frame) }
440   .debug_str      0 : { *(.debug_str) }
441   .debug_loc      0 : { *(.debug_loc) }
442   .debug_macinfo  0 : { *(.debug_macinfo) }
444   /* SGI/MIPS DWARF 2 extensions */
445   .debug_weaknames 0 : { *(.debug_weaknames) }
446   .debug_funcnames 0 : { *(.debug_funcnames) }
447   .debug_typenames 0 : { *(.debug_typenames) }
448   .debug_varnames  0 : { *(.debug_varnames) }
450   ${STACK_ADDR+${STACK}}
451   ${OTHER_SECTIONS}
452   ${RELOCATING+${OTHER_END_SYMBOLS}}
453   ${RELOCATING+${STACKNOTE}}