+# Copyright (C) 2014-2015 Free Software Foundation, Inc.
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
+
test -z "$ENTRY" && ENTRY=_start
test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
test "$LD_FLAG" = "N" && DATA_ADDR=.
-INTERP=".interp : { *(.interp) }"
-PLT=".plt : { *(.plt) }"
+INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
+PLT=".plt ${RELOCATING-0} : { *(.plt) }"
-CTOR=".ctors :
+CTOR=".ctors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+${CTOR_START}}
/* gcc uses crtbegin.o to find the start of
${CONSTRUCTING+${CTOR_END}}
}"
-DTOR=" .dtors :
+DTOR=" .dtors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+${DTOR_START}}
KEEP (*crtbegin.o(.dtors))
fi
cat <<EOF
+/* Copyright (C) 2014-2015 Free Software Foundation, Inc.
+
+ Copying and distribution of this script, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. */
+
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}")
OUTPUT_ARCH(${OUTPUT_ARCH})
.text ${RELOCATING+${TEXT_START_ADDR}} :
{
${RELOCATING+${TEXT_START_SYMBOLS}}
- KEEP (*(.init))
- KEEP (*(.init.*))
- KEEP (*(.fini))
- KEEP (*(.fini.*))
+ KEEP (*(SORT_NONE(.init)))
+ KEEP (*(SORT_NONE(.init.*)))
+ KEEP (*(SORT_NONE(.fini)))
+ KEEP (*(SORT_NONE(.fini.*)))
*(.text)
*(.text.*)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.rodata.*)
} ${RELOCATING+ >DATA}
- .rodata1 : {
+ .rodata1 ${RELOCATING-0} : {
*(.rodata1)
*(.rodata1.*)
} ${RELOCATING+ >DATA}
- .data :
+ .data ${RELOCATING-0} :
{
${RELOCATING+${DATA_START_SYMBOLS}}
*(.data)
${CONSTRUCTING+CONSTRUCTORS}
} ${RELOCATING+ >DATA}
- .data1 : {
+ .data1 ${RELOCATING-0} : {
*(.data1)
*(.data1.*)
} ${RELOCATING+ >DATA}
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
- .sdata : {
+ .sdata ${RELOCATING-0} : {
*(.sdata)
*(.sdata.*)
} ${RELOCATING+ >DATA}
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
${RELOCATING+__bss_start = .;}
- .sbss : { *(.sbss) *(.scommon) } ${RELOCATING+ >DATA}
- .bss :
+ .sbss ${RELOCATING-0} : { *(.sbss) *(.scommon) } ${RELOCATING+ >DATA}
+ .bss ${RELOCATING-0} :
{
*(.dynbss)
*(.dynbss.*)
.comment 0 : { *(.comment) }
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
-
- /* DWARF 1 */
- .debug 0 : { *(.debug) }
- .line 0 : { *(.line) }
-
- /* GNU DWARF 1 extensions */
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
-
- /* DWARF 1.1 and DWARF 2 */
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
-
- /* DWARF 2 */
- .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line) }
- .debug_frame 0 : { *(.debug_frame) }
- .debug_str 0 : { *(.debug_str) }
- .debug_loc 0 : { *(.debug_loc) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
-
- /* SGI/MIPS DWARF 2 extensions */
- .debug_weaknames 0 : { *(.debug_weaknames) }
- .debug_funcnames 0 : { *(.debug_funcnames) }
- .debug_typenames 0 : { *(.debug_typenames) }
- .debug_varnames 0 : { *(.debug_varnames) }
+EOF
+
+. $srcdir/scripttempl/DWARF.sc
+
+cat <<EOF
}
EOF