* scripttempl/elf.sc (DATA_SEGMENT_RELRO_GOTPLT_END): Delete.
[external/binutils.git] / ld / scripttempl / elf.sc
1 #
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.
56 #
57 # When adding sections, do note that the names of some sections are used
58 # when specifying the start address of the next.
59 #
60
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:
68 #
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
81 #
82 #  Each of these can also have corresponding .rel.* and .rela.* sections.
83
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}, .);"
102 fi
103 INTERP=".interp       ${RELOCATING-0} : { *(.interp) }"
104 PLT=".plt          ${RELOCATING-0} : { *(.plt) }"
105 if test -z "$GOT"; then
106   if test -z "$SEPARATE_GOTPLT"; then
107     GOT=".got          ${RELOCATING-0} : { *(.got.plt) *(.got) }"
108   else
109     GOT=".got          ${RELOCATING-0} : { *(.got) }"
110     GOTPLT=".got.plt      ${RELOCATING-0} : { *(.got.plt) }"
111   fi
112 fi
113 DYNAMIC=".dynamic      ${RELOCATING-0} : { *(.dynamic) }"
114 RODATA=".rodata       ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
115 DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }"
116 STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
117 if test -z "${NO_SMALL_DATA}"; then
118   SBSS=".sbss         ${RELOCATING-0} :
119   {
120     ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
121     *(.dynsbss)
122     *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
123     *(.scommon)
124   }"
125   SBSS2=".sbss2        ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
126   SDATA="/* We want the small data sections together, so single-instruction offsets
127      can access them all, and initialized data all before uninitialized, so
128      we can shorten the on-disk segment size.  */
129   .sdata        ${RELOCATING-0} : 
130   {
131     ${RELOCATING+${SDATA_START_SYMBOLS}}
132     ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
133     *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
134   }"
135   SDATA2=".sdata2       ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
136   REL_SDATA=".rel.sdata    ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
137   .rela.sdata   ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
138   REL_SBSS=".rel.sbss     ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
139   .rela.sbss    ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
140   REL_SDATA2=".rel.sdata2   ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
141   .rela.sdata2  ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
142   REL_SBSS2=".rel.sbss2    ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
143   .rela.sbss2   ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
144 else
145   NO_SMALL_DATA=" "
146 fi
147 test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
148 CTOR=".ctors        ${CONSTRUCTING-0} : 
149   {
150     ${CONSTRUCTING+${CTOR_START}}
151     /* gcc uses crtbegin.o to find the start of
152        the constructors, so we make sure it is
153        first.  Because this is a wildcard, it
154        doesn't matter if the user does not
155        actually link against crtbegin.o; the
156        linker won't look for a file to match a
157        wildcard.  The wildcard also means that it
158        doesn't matter which directory crtbegin.o
159        is in.  */
160
161     KEEP (*crtbegin*.o(.ctors))
162
163     /* We don't want to include the .ctor section from
164        from the crtend.o file until after the sorted ctors.
165        The .ctor section from the crtend file contains the
166        end of ctors marker and it must be last */
167
168     KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
169     KEEP (*(SORT(.ctors.*)))
170     KEEP (*(.ctors))
171     ${CONSTRUCTING+${CTOR_END}}
172   }"
173 DTOR=".dtors        ${CONSTRUCTING-0} :
174   {
175     ${CONSTRUCTING+${DTOR_START}}
176     KEEP (*crtbegin*.o(.dtors))
177     KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
178     KEEP (*(SORT(.dtors.*)))
179     KEEP (*(.dtors))
180     ${CONSTRUCTING+${DTOR_END}}
181   }"
182 STACK="  .stack        ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
183   {
184     ${RELOCATING+_stack = .;}
185     *(.stack)
186   }"
187
188 # if this is for an embedded system, don't add SIZEOF_HEADERS.
189 if [ -z "$EMBEDDED" ]; then
190    test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS"
191 else
192    test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
193 fi
194
195 cat <<EOF
196 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
197               "${LITTLE_OUTPUT_FORMAT}")
198 OUTPUT_ARCH(${OUTPUT_ARCH})
199 ENTRY(${ENTRY})
200
201 ${RELOCATING+${LIB_SEARCH_DIRS}}
202 ${RELOCATING+/* Do we need any of these for elf?
203    __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}}  */}
204 ${RELOCATING+${EXECUTABLE_SYMBOLS}}
205 ${RELOCATING+${INPUT_FILES}}
206 ${RELOCATING- /* For some reason, the Solaris linker makes bad executables
207   if gld -r is used and the intermediate file has sections starting
208   at non-zero addresses.  Could be a Solaris ld bug, could be a GNU ld
209   bug.  But for now assigning the zero vmas works.  */}
210
211 SECTIONS
212 {
213   /* Read-only sections, merged into text segment: */
214   ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
215   ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
216   ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
217   ${CREATE_SHLIB-${INTERP}}
218   ${INITIAL_READONLY_SECTIONS}
219   ${TEXT_DYNAMIC+${DYNAMIC}}
220   .hash         ${RELOCATING-0} : { *(.hash) }
221   .dynsym       ${RELOCATING-0} : { *(.dynsym) }
222   .dynstr       ${RELOCATING-0} : { *(.dynstr) }
223   .gnu.version  ${RELOCATING-0} : { *(.gnu.version) }
224   .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) }
225   .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) }
226
227 EOF
228 if [ "x$COMBRELOC" = x ]; then
229   COMBRELOCCAT=cat
230 else
231   COMBRELOCCAT="cat > $COMBRELOC"
232 fi
233 eval $COMBRELOCCAT <<EOF
234   .rel.init     ${RELOCATING-0} : { *(.rel.init) }
235   .rela.init    ${RELOCATING-0} : { *(.rela.init) }
236   .rel.text     ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
237   .rela.text    ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
238   .rel.fini     ${RELOCATING-0} : { *(.rel.fini) }
239   .rela.fini    ${RELOCATING-0} : { *(.rela.fini) }
240   .rel.rodata   ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
241   .rela.rodata  ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
242   ${OTHER_READONLY_RELOC_SECTIONS}
243   .rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+*}) }
244   .rela.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+*}) }
245   .rel.data     ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
246   .rela.data    ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
247   .rel.tdata    ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
248   .rela.tdata   ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
249   .rel.tbss     ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
250   .rela.tbss    ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
251   .rel.ctors    ${RELOCATING-0} : { *(.rel.ctors) }
252   .rela.ctors   ${RELOCATING-0} : { *(.rela.ctors) }
253   .rel.dtors    ${RELOCATING-0} : { *(.rel.dtors) }
254   .rela.dtors   ${RELOCATING-0} : { *(.rela.dtors) }
255   .rel.got      ${RELOCATING-0} : { *(.rel.got) }
256   .rela.got     ${RELOCATING-0} : { *(.rela.got) }
257   ${OTHER_GOT_RELOC_SECTIONS}
258   ${REL_SDATA}
259   ${REL_SBSS}
260   ${REL_SDATA2}
261   ${REL_SBSS2}
262   .rel.bss      ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
263   .rela.bss     ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
264 EOF
265 if [ -n "$COMBRELOC" ]; then
266 cat <<EOF
267   .rel.dyn      ${RELOCATING-0} :
268     {
269 EOF
270 sed -e '/^[     ]*[{}][         ]*$/d;/:[       ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/      \1/' $COMBRELOC
271 cat <<EOF
272     }
273   .rela.dyn     ${RELOCATING-0} :
274     {
275 EOF
276 sed -e '/^[     ]*[{}][         ]*$/d;/:[       ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/      \1/' $COMBRELOC
277 cat <<EOF
278     }
279 EOF
280 fi
281 cat <<EOF
282   .rel.plt      ${RELOCATING-0} : { *(.rel.plt) }
283   .rela.plt     ${RELOCATING-0} : { *(.rela.plt) }
284   ${OTHER_PLT_RELOC_SECTIONS}
285
286   .init         ${RELOCATING-0} : 
287   { 
288     ${RELOCATING+${INIT_START}}
289     KEEP (*(.init))
290     ${RELOCATING+${INIT_END}}
291   } =${NOP-0}
292
293   ${DATA_PLT-${BSS_PLT-${PLT}}}
294   .text         ${RELOCATING-0} :
295   {
296     ${RELOCATING+${TEXT_START_SYMBOLS}}
297     *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
298     KEEP (*(.text.*personality*))
299     /* .gnu.warning sections are handled specially by elf32.em.  */
300     *(.gnu.warning)
301     ${RELOCATING+${OTHER_TEXT_SECTIONS}}
302   } =${NOP-0}
303   .fini         ${RELOCATING-0} :
304   {
305     ${RELOCATING+${FINI_START}}
306     KEEP (*(.fini))
307     ${RELOCATING+${FINI_END}}
308   } =${NOP-0}
309   ${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);}
310   ${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
311   ${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}
312   ${WRITABLE_RODATA-${RODATA}}
313   .rodata1      ${RELOCATING-0} : { *(.rodata1) }
314   ${CREATE_SHLIB-${SDATA2}}
315   ${CREATE_SHLIB-${SBSS2}}
316   ${OTHER_READONLY_SECTIONS}
317   .eh_frame_hdr : { *(.eh_frame_hdr) }
318   .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
319   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
320
321   /* Adjust the address for the data segment.  We want to adjust up to
322      the same address within the page on the next page up.  */
323   ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
324   ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
325   ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
326
327   /* Exception handling  */
328   .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
329   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
330
331   /* Thread Local Storage sections  */
332   .tdata        ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
333   .tbss         ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
334
335   .preinit_array   ${RELOCATING-0} : { KEEP (*(.preinit_array)) }
336   .init_array   ${RELOCATING-0} : { KEEP (*(.init_array)) }
337   .fini_array   ${RELOCATING-0} : { KEEP (*(.fini_array)) }
338
339   ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
340   ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
341   .jcr          ${RELOCATING-0} : { KEEP (*(.jcr)) }
342
343   ${RELOCATING+${DATARELRO}}
344   ${OTHER_RELRO_SECTIONS}
345   ${TEXT_DYNAMIC-${DYNAMIC}}
346   ${NO_SMALL_DATA+${RELRO_NOW+${GOT}}}
347   ${NO_SMALL_DATA+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
348   ${RELOCATING+${DATA_SEGMENT_RELRO_END}}
349   ${NO_SMALL_DATA+${RELRO_NOW-${SEPARATE_GOTPLT+${GOTPLT}}}}
350   ${NO_SMALL_DATA+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
351
352   ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
353
354   .data         ${RELOCATING-0} :
355   {
356     ${RELOCATING+${DATA_START_SYMBOLS}}
357     *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
358     KEEP (*(.gnu.linkonce.d.*personality*))
359     ${CONSTRUCTING+SORT(CONSTRUCTORS)}
360   }
361   .data1        ${RELOCATING-0} : { *(.data1) }
362   ${WRITABLE_RODATA+${RODATA}}
363   ${OTHER_READWRITE_SECTIONS}
364   ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
365   ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
366   ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
367   ${RELOCATING+${OTHER_GOT_SYMBOLS}}
368   ${NO_SMALL_DATA-${GOT}}
369   ${OTHER_GOT_SECTIONS}
370   ${SDATA}
371   ${OTHER_SDATA_SECTIONS}
372   ${RELOCATING+${DATA_END_SYMBOLS-_edata = .; PROVIDE (edata = .);}}
373   /* __bss_start is used by _bfd_elf_provide_section_bound_symbols in
374      elflink.c.  */
375   ${RELOCATING+__bss_start = .;}
376   ${RELOCATING+${OTHER_BSS_SYMBOLS}}
377   ${SBSS}
378   ${BSS_PLT+${PLT}}
379   .bss          ${RELOCATING-0} :
380   {
381    *(.dynbss)
382    *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
383    *(COMMON)
384    /* Align here to ensure that the .bss section occupies space up to
385       _end.  Align after .bss to ensure correct alignment even if the
386       .bss section disappears because there are no input sections.  */
387    ${RELOCATING+. = ALIGN(${ALIGNMENT});}
388   }
389   ${OTHER_BSS_SECTIONS}
390   ${RELOCATING+. = ALIGN(${ALIGNMENT});}
391   ${RELOCATING+_end = .;}
392   ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
393   ${RELOCATING+PROVIDE (end = .);}
394   ${RELOCATING+${DATA_SEGMENT_END}}
395
396   /* Stabs debugging sections.  */
397   .stab          0 : { *(.stab) }
398   .stabstr       0 : { *(.stabstr) }
399   .stab.excl     0 : { *(.stab.excl) }
400   .stab.exclstr  0 : { *(.stab.exclstr) }
401   .stab.index    0 : { *(.stab.index) }
402   .stab.indexstr 0 : { *(.stab.indexstr) }
403
404   .comment       0 : { *(.comment) }
405
406   /* DWARF debug sections.
407      Symbols in the DWARF debugging sections are relative to the beginning
408      of the section so we begin them at 0.  */
409
410   /* DWARF 1 */
411   .debug          0 : { *(.debug) }
412   .line           0 : { *(.line) }
413
414   /* GNU DWARF 1 extensions */
415   .debug_srcinfo  0 : { *(.debug_srcinfo) }
416   .debug_sfnames  0 : { *(.debug_sfnames) }
417
418   /* DWARF 1.1 and DWARF 2 */
419   .debug_aranges  0 : { *(.debug_aranges) }
420   .debug_pubnames 0 : { *(.debug_pubnames) }
421
422   /* DWARF 2 */
423   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
424   .debug_abbrev   0 : { *(.debug_abbrev) }
425   .debug_line     0 : { *(.debug_line) }
426   .debug_frame    0 : { *(.debug_frame) }
427   .debug_str      0 : { *(.debug_str) }
428   .debug_loc      0 : { *(.debug_loc) }
429   .debug_macinfo  0 : { *(.debug_macinfo) }
430
431   /* SGI/MIPS DWARF 2 extensions */
432   .debug_weaknames 0 : { *(.debug_weaknames) }
433   .debug_funcnames 0 : { *(.debug_funcnames) }
434   .debug_typenames 0 : { *(.debug_typenames) }
435   .debug_varnames  0 : { *(.debug_varnames) }
436
437   ${STACK_ADDR+${STACK}}
438   ${OTHER_SECTIONS}
439   ${RELOCATING+${OTHER_END_SYMBOLS}}
440   ${RELOCATING+${STACKNOTE}}
441 }
442 EOF