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