+2018-10-13 Alan Modra <amodra@gmail.com>
+
+ * Makefile.am (eelf32btsmip_fbsd.c, eelf32btsmipn32_fbsd.c),
+ (eelf32epiphany.c, eelf32epiphany_4x4.c, eelf32ltsmip_fbsd.c),
+ (eelf32ltsmipn32_fbsd.c, eelf32xc16x.c, eelf32xc16xl.c),
+ (eelf32xc16xs.c, emcorepe.c, enios2elf.c, enios2linux.c),
+ (eelf64btsmip_fbsd.c, eelf64ltsmip_fbsd.c): Correct dependencies.
+ * Makefile.in: Regenerate.
+ * emulparams/aarch64cloudabi.sh, * emulparams/aarch64fbsd.sh,
+ * emulparams/aarch64linux.sh, * emulparams/aarch64linux32.sh,
+ * emulparams/arc-nps.sh, * emulparams/elf32_spu.sh,
+ * emulparams/elf32_tic6x_le.sh, * emulparams/elf32bmip.sh,
+ * emulparams/elf32btsmipn32.sh, * emulparams/elf32lr5900n32.sh,
+ * emulparams/elf32mep.sh, * emulparams/elf32metag.sh,
+ * emulparams/elf64btsmip.sh, * emulparams/shelf_vxworks.sh,
+ * emulparams/shlelf_fd.sh, * scripttempl/DWARF.sc,
+ * scripttempl/alpha.sc, * scripttempl/alphavms.sc,
+ * scripttempl/arclinux.sc, * scripttempl/armbpabi.sc,
+ * scripttempl/avr.sc, * scripttempl/dlx.sc, * scripttempl/elf.sc,
+ * scripttempl/elf32cr16.sc, * scripttempl/elf32cr16c.sc,
+ * scripttempl/elf32crx.sc, * scripttempl/elf32msp430.sc,
+ * scripttempl/elf32msp430_3.sc, * scripttempl/elf32xc16x.sc,
+ * scripttempl/elf32xc16xl.sc, * scripttempl/elf32xc16xs.sc,
+ * scripttempl/elf64hppa.sc, * scripttempl/elf_chaos.sc,
+ * scripttempl/elfarc.sc, * scripttempl/elfarcv2.sc,
+ * scripttempl/elfd10v.sc, * scripttempl/elfd30v.sc,
+ * scripttempl/elfm68hc11.sc, * scripttempl/elfm68hc12.sc,
+ * scripttempl/elfm9s12z.sc, * scripttempl/elfmicroblaze.sc,
+ * scripttempl/elfxgate.sc, * scripttempl/elfxtensa.sc,
+ * scripttempl/epiphany_4x4.sc, * scripttempl/ft32.sc,
+ * scripttempl/hppaelf.sc, * scripttempl/ia64vms.sc,
+ * scripttempl/ip2k.sc, * scripttempl/iq2000.sc,
+ * scripttempl/mep.sc, * scripttempl/mmo.sc,
+ * scripttempl/nds32elf.sc, * scripttempl/pru.sc,
+ * scripttempl/sh.sc, * scripttempl/v850.sc,
+ * scripttempl/v850_rh850.sc, * scripttempl/visium.sc,
+ * scripttempl/xstormy16.sc: Condition various parts of scripts on
+ ${RELOCATABLE} in order to prevent ld -r merging sections or
+ defining symbols. Remove MEMORY and VERSION definitions from
+ ld -r scripts too.
+ * testsuite/ld-elf/group2.d, * testsuite/ld-elf/group4.d,
+ * testsuite/ld-elf/group5.d, * testsuite/ld-elf/group6.d,
+ * testsuite/ld-elf/group7.d, * testsuite/ld-elf/group8a.d,
+ * testsuite/ld-elf/group8b.d, * testsuite/ld-elf/group9a.d,
+ * testsuite/ld-elf/group9b.d, * testsuite/ld-elf/pr17550a.d,
+ * testsuite/ld-elf/pr17550b.d,
+ * testsuite/ld-elf/pr17550d.d: Don't xfail cr16 and crx.
+ * testsuite/ld-elf/init-fini-arrays.d,
+ * testsuite/ld-elf/pr22677.d: Likewise, and dont' xfail mep.
+
2018-10-08 H.J. Lu <hongjiu.lu@intel.com>
PR ld/23428
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32btsmip_fbsd.c: $(srcdir)/emulparams/elf32btsmip_fbsd.sh \
+ ${srcdir}/emulparams/elf32btsmip.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32btsmipn32_fbsd.c: $(srcdir)/emulparams/elf32btsmipn32_fbsd.sh \
+ ${srcdir}/emulparams/elf32ltsmipn32.sh ${srcdir}/emulparams/elf_fbsd.sh \
+ ${srcdir}/emulparams/elf32btsmipn32.sh \
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GEN_DEPENDS}
eelf32epiphany.c: $(srcdir)/emulparams/elf32epiphany.sh \
- $(ELF_DEPS) ${GEN_DEPENDS}
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32epiphany_4x4.c: $(srcdir)/emulparams/elf32epiphany_4x4.sh \
- $(srcdir)/emultempl/elf32.em \
$(ELF_DEPS) $(srcdir)/scripttempl/epiphany_4x4.sc ${GEN_DEPENDS}
eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32ft32.c: $(srcdir)/emulparams/elf32ft32.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(ELF_GEN_DEPS) $(srcdir)/scripttempl/ft32.sc ${GEN_DEPENDS}
eelf32ip2k.c: $(srcdir)/emulparams/elf32ip2k.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GEN_DEPENDS}
eelf32ltsmip_fbsd.c: $(srcdir)/emulparams/elf32ltsmip_fbsd.sh \
+ ${srcdir}/emulparams/elf32ltsmip.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
$(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
${GEN_DEPENDS}
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32ltsmipn32_fbsd.c: $(srcdir)/emulparams/elf32ltsmipn32_fbsd.sh \
+ ${srcdir}/emulparams/elf32ltsmipn32.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf32btsmipn32.sh \
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32xc16x.c: $(srcdir)/emulparams/elf32xc16x.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/scripttempl/elf32xc16x.sc ${GEN_DEPENDS}
eelf32xc16xl.c: $(srcdir)/emulparams/elf32xc16xl.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/scripttempl/elf32xc16xl.sc ${GEN_DEPENDS}
eelf32xc16xs.c: $(srcdir)/emulparams/elf32xc16xs.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/scripttempl/elf32xc16xs.sc ${GEN_DEPENDS}
eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elfm9s12z.sc ${GEN_DEPENDS}
emcorepe.c: $(srcdir)/emulparams/mcorepe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/mcorepe.sc ${GEN_DEPENDS}
emn10200.c: $(srcdir)/emulparams/mn10200.sh \
$(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
enios2elf.c: $(srcdir)/emulparams/nios2elf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/nios2elf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/scripttempl/elf.sc $(srcdir)/scripttempl/DWARF.sc ${GEN_DEPENDS}
enios2linux.c: $(srcdir)/emulparams/nios2linux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/nios2elf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/scripttempl/elf.sc $(srcdir)/scripttempl/DWARF.sc ${GEN_DEPENDS}
ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf64btsmip_fbsd.c: $(srcdir)/emulparams/elf64btsmip_fbsd.sh \
+ ${srcdir}/emulparams/elf64btsmip.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf64bmip-defs.sh \
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf64ltsmip_fbsd.c: $(srcdir)/emulparams/elf64ltsmip_fbsd.sh \
- $(srcdir)/emulparams/elf64btsmip_fbsd.sh $(srcdir)/emulparams/elf64bmip-defs.sh \
+ ${srcdir}/emulparams/elf64ltsmip.sh ${srcdir}/emulparams/elf_fbsd.sh \
+ $(srcdir)/emulparams/elf64btsmip.sh $(srcdir)/emulparams/elf64bmip-defs.sh \
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32btsmip_fbsd.c: $(srcdir)/emulparams/elf32btsmip_fbsd.sh \
+ ${srcdir}/emulparams/elf32btsmip.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32btsmipn32_fbsd.c: $(srcdir)/emulparams/elf32btsmipn32_fbsd.sh \
+ ${srcdir}/emulparams/elf32ltsmipn32.sh ${srcdir}/emulparams/elf_fbsd.sh \
+ ${srcdir}/emulparams/elf32btsmipn32.sh \
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GEN_DEPENDS}
eelf32epiphany.c: $(srcdir)/emulparams/elf32epiphany.sh \
- $(ELF_DEPS) ${GEN_DEPENDS}
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32epiphany_4x4.c: $(srcdir)/emulparams/elf32epiphany_4x4.sh \
- $(srcdir)/emultempl/elf32.em \
$(ELF_DEPS) $(srcdir)/scripttempl/epiphany_4x4.sc ${GEN_DEPENDS}
eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32ft32.c: $(srcdir)/emulparams/elf32ft32.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(ELF_GEN_DEPS) $(srcdir)/scripttempl/ft32.sc ${GEN_DEPENDS}
eelf32ip2k.c: $(srcdir)/emulparams/elf32ip2k.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GEN_DEPENDS}
eelf32ltsmip_fbsd.c: $(srcdir)/emulparams/elf32ltsmip_fbsd.sh \
+ ${srcdir}/emulparams/elf32ltsmip.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
$(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
${GEN_DEPENDS}
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32ltsmipn32_fbsd.c: $(srcdir)/emulparams/elf32ltsmipn32_fbsd.sh \
+ ${srcdir}/emulparams/elf32ltsmipn32.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf32btsmipn32.sh \
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32xc16x.c: $(srcdir)/emulparams/elf32xc16x.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/scripttempl/elf32xc16x.sc ${GEN_DEPENDS}
eelf32xc16xl.c: $(srcdir)/emulparams/elf32xc16xl.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/scripttempl/elf32xc16xl.sc ${GEN_DEPENDS}
eelf32xc16xs.c: $(srcdir)/emulparams/elf32xc16xs.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/scripttempl/elf32xc16xs.sc ${GEN_DEPENDS}
eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elfm9s12z.sc ${GEN_DEPENDS}
emcorepe.c: $(srcdir)/emulparams/mcorepe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
+ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/mcorepe.sc ${GEN_DEPENDS}
emn10200.c: $(srcdir)/emulparams/mn10200.sh \
$(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
enios2elf.c: $(srcdir)/emulparams/nios2elf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/nios2elf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/scripttempl/elf.sc $(srcdir)/scripttempl/DWARF.sc ${GEN_DEPENDS}
enios2linux.c: $(srcdir)/emulparams/nios2linux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/nios2elf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ $(srcdir)/scripttempl/elf.sc $(srcdir)/scripttempl/DWARF.sc ${GEN_DEPENDS}
ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf64btsmip_fbsd.c: $(srcdir)/emulparams/elf64btsmip_fbsd.sh \
+ ${srcdir}/emulparams/elf64btsmip.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf64bmip-defs.sh \
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf64ltsmip_fbsd.c: $(srcdir)/emulparams/elf64ltsmip_fbsd.sh \
- $(srcdir)/emulparams/elf64btsmip_fbsd.sh $(srcdir)/emulparams/elf64bmip-defs.sh \
+ ${srcdir}/emulparams/elf64ltsmip.sh ${srcdir}/emulparams/elf_fbsd.sh \
+ $(srcdir)/emulparams/elf64btsmip.sh $(srcdir)/emulparams/elf64bmip-defs.sh \
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
# Ensure each PLT entry is aligned to a cache line.
-PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${IREL_IN_PLT+ *(.iplt)} }"
+PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} }"
OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
# Ensure each PLT entry is aligned to a cache line.
-PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${IREL_IN_PLT+ *(.iplt)} }"
+PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} }"
OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
# Ensure each PLT entry is aligned to a cache line.
-PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${IREL_IN_PLT+ *(.iplt)} }"
+PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} }"
# Linux modifies the default library search path to first include
# a 64-bit specific directory.
OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
# Ensure each PLT entry is aligned to a cache line.
-PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${IREL_IN_PLT+ *(.iplt)} }"
+PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} }"
# Linux modifies the default library search path to first include
# a 32-bit specific directory.
+if test -n "${RELOCATING}"; then
OTHER_SECTIONS="
/* Start of symbols and sections required to support CMEM instructions
on NPS targets. */
/* End of nps specific sections and symbols. */
${OTHER_SECTIONS}"
+fi
DATA_ADDR="ALIGN(${MAXPAGESIZE})"
OTHER_BSS_SECTIONS=".toe ALIGN(128) : { *(.toe) } = 0"
OTHER_SECTIONS=".note.spu_name 0 : { KEEP(*(.note.spu_name)) }
- ._ea 0 : { KEEP(*(._ea)) KEEP(*(._ea.*)) }"
+ ._ea 0 : { KEEP(*(._ea))${RELOCATING+ KEEP(*(._ea.*))} }"
OTHER_READONLY_SECTIONS="
.fixup ${RELOCATING-0} : {
- PROVIDE (__fixup_start = .);
+ ${RELOCATING+PROVIDE (__fixup_start = .);}
KEEP(*(.fixup))
}"
TEXT_START_ADDR=0x0
GOT="
.got ${RELOCATING-0} : {
- *(.dsbt)
- *(.got.plt) *(.igot.plt) *(.got) *(.igot)
+ ${RELOCATING+*(.dsbt)
+ *(.got.plt) *(.igot.plt) }*(.got)${RELOCATING+ *(.igot)}
}"
;;
esac
TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};"
DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fdata = .${CREATE_SHLIB+)};"
OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fbss = .${CREATE_SHLIB+)};"
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+OTHER_SECTIONS="
+ .gptab.sdata : {${RELOCATING+ *(.gptab.data)} *(.gptab.sdata) }
+ .gptab.sbss : {${RELOCATING+ *(.gptab.bss)} *(.gptab.sbss) }
.mdebug.abi32 0 : { KEEP(*(.mdebug.abi32)) }
.mdebug.abiN32 0 : { KEEP(*(.mdebug.abiN32)) }
.mdebug.abi64 0 : { KEEP(*(.mdebug.abi64)) }
.mdebug.eabi64 0 : { KEEP(*(.mdebug.eabi64)) }
.gcc_compiled_long32 0 : { KEEP(*(.gcc_compiled_long32)) }
.gcc_compiled_long64 0 : { KEEP(*(.gcc_compiled_long64)) }
-'
+"
ARCH=mips
MACHINE=
TEMPLATE_NAME=elf32
# Magic sections.
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
-'
+OTHER_SECTIONS="
+ .gptab.sdata : {${RELOCATING+ *(.gptab.data)} *(.gptab.sdata) }
+ .gptab.sbss : {${RELOCATING+ *(.gptab.bss)} *(.gptab.sbss) }
+"
DYNAMIC_LINK=FALSE
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
-'
+OTHER_SECTIONS="
+ .gptab.sdata : {${RELOCATING+ *(.gptab.data)} *(.gptab.sdata) }
+ .gptab.sbss : {${RELOCATING+ *(.gptab.bss)} *(.gptab.sbss) }
+"
unset DATA_ADDR
SHLIB_TEXT_START_ADDR=0
ENTRY=_start
EMBEDDED=yes
TEMPLATE_NAME=elf32
+
+if test -n "${RELOCATING}"; then
DATA_START_SYMBOLS='__data_start = . ;'
OTHER_GOT_SYMBOLS='
. = ALIGN(4);
__assert_near_size = ASSERT (. <= 0x1000000, "near section overflow");
.farbss : { PROVIDE (__farbss_start = .); *(.farbss) *(.farbss.*) PROVIDE (__farbss_end = .); }
'
+fi
NOP=0xa0fffffe
EXTRA_EM_FILE=metagelf
USER_LABEL_PREFIX=_
-OTHER_SECTIONS="
+test -n "${RELOCATING}" && OTHER_SECTIONS="
.core_text 0x80000000 :
{
*(.core_text)
# Magic sections.
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
-'
+OTHER_SECTIONS="
+ .gptab.sdata : {${RELOCATING+ *(.gptab.data)} *(.gptab.sdata) }
+ .gptab.sbss : {${RELOCATING+ *(.gptab.bss)} *(.gptab.sbss) }
+"
TEXT_START_ADDR="0x120000000"
SYMPREFIX=_
GOT=".got ${RELOCATING-0} : {
- PROVIDE(__GLOBAL_OFFSET_TABLE_ = .);
- *(.got.plt) *(.got) }"
+ ${RELOCATING+PROVIDE(__GLOBAL_OFFSET_TABLE_ = .);
+ *(.got.plt) }*(.got) }"
. ${srcdir}/emulparams/vxworks.sh
. ${srcdir}/emulparams/shlelf_linux.sh
OUTPUT_FORMAT="elf32-sh-fdpic"
-GOT=".got ${RELOCATING-0} : { *(.got.funcdesc) *(.got.plt) *(.got) }"
+GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.funcdesc) *(.got.plt)} *(.got) }"
OTHER_GOT_RELOC_SECTIONS="
.rela.got.funcdesc ${RELOCATING-0} : { *(.rela.got.funcdesc) }
"
/* DWARF 2 */
.debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) }
.debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
+ .debug_line 0 : { *(.debug_line${RELOCATING+ .debug_line.* .debug_line_end}) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
{
${RELOCATING+. = ${TEXT_START_ADDR};}
.text : {
- ${RELOCATING+ _ftext = . };
- ${RELOCATING+ __istart = . };
- ${RELOCATING+ *(.init) }
+ ${RELOCATING+ _ftext = .;}
+ ${RELOCATING+ __istart = .;}
+ ${RELOCATING+ *(.init)}
${RELOCATING+ LONG (0x6bfa8001)}
- ${RELOCATING+ eprol = .};
+ ${RELOCATING+ eprol = .;}
*(.text)
- ${RELOCATING+ __fstart = . };
+ ${RELOCATING+ __fstart = .;}
${RELOCATING+ *(.fini)}
${RELOCATING+ LONG (0x6bfa8001)}
- ${RELOCATING+ _etext = .};
+ ${RELOCATING+ _etext = .;}
}
.rdata : {
*(.rdata)
${RELOCATING+ _FBSS = .;}
.sbss : {
*(.sbss)
- *(.scommon)
+ ${RELOCATING+*(.scommon)}
}
.bss : {
*(.bss)
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
}
${RELOCATING+ _end = .;}
}
}
/* RO, executable code. */
\$CODE\$ ALIGN (${PAGESIZE}) : {
- *(\$CODE\$ *\$CODE*)
+ *(\$CODE\$${RELOCATING+ *\$CODE*})
}
/* RO initialized data. */
\$LITERAL\$ ALIGN (${PAGESIZE}) : {
- *(\$LINK\$)
+ ${RELOCATING+*(\$LINK\$)}
*(\$LITERAL\$)
- *(\$READONLY\$)
+ ${RELOCATING+*(\$READONLY\$)
*(\$READONLY_ADDR\$)
*(eh_frame)
*(jcr)
*(LIB\$INITIALIZDZ) /* Start marker. */
*(LIB\$INITIALIZD_) /* Hi priority. */
*(LIB\$INITIALIZE) /* User. */
- *(LIB\$INITIALIZE$) /* End marker. */
+ *(LIB\$INITIALIZE$) /* End marker. */}
}
\$DWARF\$ ALIGN (${PAGESIZE}) : {
- \$dwarf2.debug_pubtypes = .;
+ ${RELOCATING+\$dwarf2.debug_pubtypes = .;
*(debug_pubtypes)
\$dwarf2.debug_ranges = .;
*(debug_ranges)
*(debug_pubnames)
\$dwarf2.debug_str = .;
*(debug_str)
- \$dwarf2.debug_zzzzzz = .;
+ \$dwarf2.debug_zzzzzz = .;}
}
\$DST\$ 0 : {
fi
if test -z "$PLT"; then
IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }"
- PLT=".plt ${RELOCATING-0} : { *(.plt)${IREL_IN_PLT+ *(.iplt)} }
+ PLT=".plt ${RELOCATING-0} : { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} }
${IREL_IN_PLT-$IPLT}"
fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=
if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then
- GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }"
+ GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt) *(.igot.plt)} *(.got)${RELOCATING+ *(.igot)} }"
else
- GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }"
- GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }"
+ GOT=".got ${RELOCATING-0} : { *(.got)${RELOCATING+ *(.igot)} }"
+ GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt)${RELOCATING+ *(.igot.plt)} }"
fi
fi
REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }"
{
${RELOCATING+${SBSS_START_SYMBOLS}}
${CREATE_SHLIB+*(.${SBSS_NAME}2 .${SBSS_NAME}2.* .gnu.linkonce.sb2.*)}
- *(.dyn${SBSS_NAME})
+ ${RELOCATING+*(.dyn${SBSS_NAME})}
*(.${SBSS_NAME}${RELOCATING+ .${SBSS_NAME}.* .gnu.linkonce.sb.*})
- *(.scommon)
+ ${RELOCATING+*(.scommon)}
${RELOCATING+${SBSS_END_SYMBOLS}}
}"
SBSS2=".${SBSS_NAME}2 ${RELOCATING-0} : { *(.${SBSS_NAME}2${RELOCATING+ .${SBSS_NAME}2.* .gnu.linkonce.sb2.*}) }"
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) ${RELOCATING+*(.eh_frame_entry .eh_frame_entry.*)} }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) ${RELOCATING+*(.eh_frame.*)} }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table
- .gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
.gnu_extab ${RELOCATING-0} : ONLY_IF_RO { *(.gnu_extab*) }
/* These sections are generated by the Sun/Oracle C++ compiler. */
- .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges
- .exception_ranges*) }
+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges${RELOCATING+*}) }
${TEXT_PLT+${PLT_NEXT_DATA+${PLT}}}
/* Adjust the address for the data segment. We want to adjust up to
/* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) ${RELOCATING+*(.eh_frame.*)} }
.gnu_extab ${RELOCATING-0} : ONLY_IF_RW { *(.gnu_extab) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
- .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges${RELOCATING+*}) }
/* Thread Local Storage sections */
- .tdata ${RELOCATING-0} : { PROVIDE_HIDDEN(.tdata = .); *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
- .tbss ${RELOCATING-0} : { PROVIDE_HIDDEN(.tbss = .); *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
+ .tdata ${RELOCATING-0} : { ${RELOCATING+PROVIDE_HIDDEN(.tdata = .); }*(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
+ .tbss ${RELOCATING-0} : { ${RELOCATING+PROVIDE_HIDDEN(.tbss = .); }*(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
.preinit_array ${RELOCATING-0} :
{
${BSS_PLT+${PLT}}
.${BSS_NAME} ${RELOCATING-0} :
{
- *(.dyn${BSS_NAME})
- *(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
- *(COMMON)
- /* Align here to ensure that the .bss section occupies space up to
- _end. Align after .bss to ensure correct alignment even if the
- .bss section disappears because there are no input sections.
- FIXME: Why do we need it? When there is no .bss section, we don't
- pad the .data section. */
- ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
+ ${RELOCATING+*(.dyn${BSS_NAME})}
+ *(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
+ ${RELOCATING+*(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we do not
+ pad the .data section. */
+ . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
}
${OTHER_BSS_SECTIONS}
${LARGE_BSS_AFTER_BSS+${LARGE_BSS}}
{
${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);}
- *(.dynsbss)
+ ${RELOCATING+*(.dynsbss)}
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
- *(.scommon)
+ ${RELOCATING+*(.scommon)}
${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);}
}"
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}")
OUTPUT_ARCH(${OUTPUT_ARCH})
-${RELOCATING+ENTRY(${ENTRY})}
-
-${RELOCATING+${LIB_SEARCH_DIRS}}
-${RELOCATING+/* Do we need any of these for elf?
- __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
-${RELOCATING+${EXECUTABLE_SYMBOLS}}
-${RELOCATING+${INPUT_FILES}}
-${RELOCATING- /* For some reason, the Solaris linker makes bad executables
- if gld -r is used and the intermediate file has sections starting
- at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
- bug. But for now assigning the zero vmas works. */}
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
+ENTRY(${ENTRY})
+
+${LIB_SEARCH_DIRS}
+/* Do we need any of these for elf?
+ __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */
+${EXECUTABLE_SYMBOLS}
+${INPUT_FILES}
/* ARM's proprietary toolchain generate these symbols to match the start
and end of particular sections of the image. SymbianOS uses these
};
}
+EOF
+
+cat <<EOF
SECTIONS
{
/* Read-only sections, merged into text segment: */
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table${RELOCATING+ .gcc_except_table.*})) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
/* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table${RELOCATING+ .gcc_except_table.*})) }
/* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} :
{
- *(.dynbss)
+ ${RELOCATING+*(.dynbss)}
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
- *(COMMON)
+ ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
- ${RELOCATING+. = ALIGN(${ALIGNMENT});}
+ . = ALIGN(${ALIGNMENT});}
}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});}
OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
+EOF
+test -n "${RELOCATING}" && cat <<EOF
__TEXT_REGION_LENGTH__ = DEFINED(__TEXT_REGION_LENGTH__) ? __TEXT_REGION_LENGTH__ : $TEXT_LENGTH;
__DATA_REGION_LENGTH__ = DEFINED(__DATA_REGION_LENGTH__) ? __DATA_REGION_LENGTH__ : $DATA_LENGTH;
${EEPROM_LENGTH+__EEPROM_REGION_LENGTH__ = DEFINED(__EEPROM_REGION_LENGTH__) ? __EEPROM_REGION_LENGTH__ : $EEPROM_LENGTH;}
signature (rw!x) : ORIGIN = 0x840000, LENGTH = __SIGNATURE_REGION_LENGTH__
${USER_SIGNATURE_LENGTH+ user_signatures (rw!x) : ORIGIN = 0x850000, LENGTH = __USER_SIGNATURE_REGION_LENGTH__}
}
+EOF
+cat <<EOF
SECTIONS
{
/* Read-only sections, merged into text segment: */
/* Internal text space or external memory. */
.text ${RELOCATING-0} :
{
- *(.vectors)
+ ${RELOCATING+*(.vectors)
KEEP(*(.vectors))
/* For data that needs to reside in the lower 64k of progmem. */
- ${RELOCATING+ *(.progmem.gcc*)}
+ *(.progmem.gcc*)
/* PR 13812: Placing the trampolines here gives a better chance
that they will be in range of the code that uses them. */
- ${RELOCATING+. = ALIGN(2);}
- ${CONSTRUCTING+ __trampolines_start = . ; }
+ . = ALIGN(2);
+ __trampolines_start = . ;
/* The jump trampolines for the 16-bit limited relocs will reside here. */
*(.trampolines)
- ${RELOCATING+ *(.trampolines*)}
- ${CONSTRUCTING+ __trampolines_end = . ; }
+ *(.trampolines*)
+ __trampolines_end = . ;
/* avr-libc expects these data to reside in lower 64K. */
- ${RELOCATING+ *libprintf_flt.a:*(.progmem.data)}
- ${RELOCATING+ *libc.a:*(.progmem.data)}
+ *libprintf_flt.a:*(.progmem.data)
+ *libc.a:*(.progmem.data)
- ${RELOCATING+ *(.progmem.*)}
+ *(.progmem.*)
- ${RELOCATING+. = ALIGN(2);}
+ . = ALIGN(2);
/* For code that needs to reside in the lower 128k progmem. */
*(.lowtext)
- ${RELOCATING+ *(.lowtext*)}
+ *(.lowtext*)}
${CONSTRUCTING+ __ctors_start = . ; }
${CONSTRUCTING+ *(.ctors) }
${CONSTRUCTING+ __dtors_start = . ; }
${CONSTRUCTING+ *(.dtors) }
${CONSTRUCTING+ __dtors_end = . ; }
- KEEP(SORT(*)(.ctors))
+ ${RELOCATING+KEEP(SORT(*)(.ctors))
KEEP(SORT(*)(.dtors))
- /* From this point on, we don't bother about wether the insns are
+ /* From this point on, we do not bother about whether the insns are
below or above the 16 bits boundary. */
*(.init0) /* Start here after reset. */
KEEP (*(.init0))
*(.init8)
KEEP (*(.init8))
*(.init9) /* Call main(). */
- KEEP (*(.init9))
+ KEEP (*(.init9))}
*(.text)
- ${RELOCATING+. = ALIGN(2);}
- ${RELOCATING+ *(.text.*)}
- ${RELOCATING+. = ALIGN(2);}
+ ${RELOCATING+. = ALIGN(2);
+ *(.text.*)
+ . = ALIGN(2);
*(.fini9) /* _exit() starts here. */
KEEP (*(.fini9))
*(.fini8)
/* For code that needs not to reside in the lower progmem. */
*(.hightext)
- ${RELOCATING+ *(.hightext*)}
+ *(.hightext*)
- ${RELOCATING+ *(.progmemx.*)}
+ *(.progmemx.*)
- ${RELOCATING+. = ALIGN(2);}
+ . = ALIGN(2);
- /* For tablejump instruction arrays. We don't relax
+ /* For tablejump instruction arrays. We do not relax
JMP / CALL instructions within these sections. */
*(.jumptables)
- ${RELOCATING+ *(.jumptables*)}
+ *(.jumptables*)
- ${RELOCATING+ _etext = . ; }
+ _etext = . ;}
} ${RELOCATING+ > text}
EOF
.rodata ${RELOCATING+ ADDR(.text) + SIZEOF (.text) + __RODATA_PM_OFFSET__ } ${RELOCATING-0} :
{
*(.rodata)
- ${RELOCATING+ *(.rodata*)}
- *(.gnu.linkonce.r*)
+ ${RELOCATING+ *(.rodata*)
+ *(.gnu.linkonce.r*)}
} ${RELOCATING+AT> text}
EOF
fi
{
${RELOCATING+ PROVIDE (__data_start = .) ; }
*(.data)
- ${RELOCATING+ *(.data*)}
- *(.gnu.linkonce.d*)
+ ${RELOCATING+ *(.data*)
+ *(.gnu.linkonce.d*)}
EOF
# Classical devices that don't show flash memory in the SRAM address space
# need .rodata to be part of .data because the compiler will use LD*
# instructions and LD* cannot access flash.
-if test -z "$RODATA_PM_OFFSET"; then
+if test -z "$RODATA_PM_OFFSET" && test -n "${RELOCATING}"; then
cat <<EOF
*(.rodata) /* We need to include .rodata here if gcc is used */
- ${RELOCATING+ *(.rodata*)} /* with -fdata-sections. */
+ *(.rodata*) /* with -fdata-sections. */
*(.gnu.linkonce.r*)
EOF
fi
${RELOCATING+ PROVIDE (__bss_start = .) ; }
*(.bss)
${RELOCATING+ *(.bss*)}
- *(COMMON)
+ ${RELOCATING+ *(COMMON)}
${RELOCATING+ PROVIDE (__bss_end = .) ; }
} ${RELOCATING+ > data}
.fuse ${RELOCATING-0}:
{
KEEP(*(.fuse))
- KEEP(*(.lfuse))
+ ${RELOCATING+KEEP(*(.lfuse))
KEEP(*(.hfuse))
- KEEP(*(.efuse))
+ KEEP(*(.efuse))}
} ${RELOCATING+ > fuse}
EOF
fi
${RELOCATING+. = ${TEXT_START_ADDR};}
.text :
{
- CREATE_OBJECT_SYMBOLS
+ ${RELOCATING+CREATE_OBJECT_SYMBOLS}
*(.text)
${RELOCATING+etext = ${DATA_ALIGNMENT};}
}
.bss :
{
*(.bss)
- *(COMMON)
- ${RELOCATING+end = . };
+ ${RELOCATING+*(COMMON)}
+ ${RELOCATING+end = .;}
}
}
EOF
fi
if test -z "$PLT"; then
IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }"
- PLT=".plt ${RELOCATING-0} : { *(.plt)${IREL_IN_PLT+ *(.iplt)} }
+ PLT=".plt ${RELOCATING-0} : { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} }
${IREL_IN_PLT-$IPLT}"
fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=
if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then
- GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }"
+ GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt) *(.igot.plt)} *(.got)${RELOCATING+ *(.igot)} }"
else
- GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }"
- GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }"
+ GOT=".got ${RELOCATING-0} : { *(.got)${RELOCATING+ *(.igot)} }"
+ GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt)${RELOCATING+ *(.igot.plt)} }"
fi
fi
REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }"
{
${RELOCATING+${SBSS_START_SYMBOLS}}
${CREATE_SHLIB+*(.${SBSS_NAME}2 .${SBSS_NAME}2.* .gnu.linkonce.sb2.*)}
- *(.dyn${SBSS_NAME})
+ ${RELOCATING+*(.dyn${SBSS_NAME})}
*(.${SBSS_NAME}${RELOCATING+ .${SBSS_NAME}.* .gnu.linkonce.sb.*})
- *(.scommon)
+ ${RELOCATING+*(.scommon)}
${RELOCATING+${SBSS_END_SYMBOLS}}
}"
SBSS2=".${SBSS_NAME}2 ${RELOCATING-0} : { *(.${SBSS_NAME}2${RELOCATING+ .${SBSS_NAME}2.* .gnu.linkonce.sb2.*}) }"
test "${LARGE_SECTIONS}" = "yes" && LARGE_BSS="
.lbss ${RELOCATING-0} :
{
- *(.dynlbss)
+ ${RELOCATING+*(.dynlbss)}
*(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
- *(LARGE_COMMON)
+ ${RELOCATING+*(LARGE_COMMON)}
}"
test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
.lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
*(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*})
${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
}"
-PREINIT_ARRAY=".preinit_array ${RELOCATING-0} :
- {
- ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}}
- KEEP (*(.preinit_array))
- ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}}
- }"
if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
CTORS_IN_INIT_ARRAY=
DTORS_IN_FINI_ARRAY=
fi
-INIT_ARRAY=".init_array ${RELOCATING-0} :
+PREINIT_ARRAY=".preinit_array :
{
- ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}}
+ ${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}
+ KEEP (*(.preinit_array))
+ ${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}
+ }"
+INIT_ARRAY=".init_array :
+ {
+ ${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}
${SORT_INIT_ARRAY}
KEEP (*(.init_array ${CTORS_IN_INIT_ARRAY}))
- ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}}
+ ${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}
}"
-FINI_ARRAY=".fini_array ${RELOCATING-0} :
+FINI_ARRAY=".fini_array :
{
- ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}}
+ ${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}
${SORT_FINI_ARRAY}
KEEP (*(.fini_array ${DTORS_IN_FINI_ARRAY}))
- ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}}
+ ${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}
}"
CTOR=".ctors ${CONSTRUCTING-0} :
{
if test -z "$TINY_READONLY_SECTION"; then
case "$LD_FLAG" in
*textonly*)
- SEPARATE_TEXT=yes
+ SEPARATE_TEXT=" "
TEXT_SEGMENT_ALIGN=". = ALIGN(${MAXPAGESIZE});"
;;
esac
SECTIONS
{
- /* Read-only sections, merged into text segment: */
+ ${RELOCATING+${SEPARATE_TEXT-/* Read-only sections, merged into text segment: */}}
${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR}${SIZEOF_HEADERS_CODE};}}
${CREATE_PIE+${RELOCATING+PROVIDE (__executable_start = ${SHLIB_TEXT_START_ADDR}); . = ${SHLIB_TEXT_START_ADDR}${SIZEOF_HEADERS_CODE};}}
SHLIB_RODATA_ADDR="SEGMENT_START(\"rodata-segment\", ${SHLIB_RODATA_ADDR})"
fi
cat <<EOF
- /* Adjust the address for the rodata segment. We want to adjust up to
+ ${RELOCATING+/* Adjust the address for the rodata segment. We want to adjust up to
the same address within the page on the next page up. */
- ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${RODATA_ADDR};}}}
- ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_RODATA_ADDR};}}
- ${CREATE_PIE+${RELOCATING+. = ${SHLIB_RODATA_ADDR};}}
+ ${CREATE_SHLIB-${CREATE_PIE-. = ${RODATA_ADDR};}}
+ ${CREATE_SHLIB+. = ${SHLIB_RODATA_ADDR};}
+ ${CREATE_PIE+. = ${SHLIB_RODATA_ADDR};}}
EOF
if test -n "${SEPARATE_CODE}"; then
emit_early_ro
${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}}
${OTHER_READONLY_SECTIONS}
- .eh_frame_hdr : { *(.eh_frame_hdr) ${RELOCATING+*(.eh_frame_entry .eh_frame_entry.*)} }
- .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) ${RELOCATING+*(.eh_frame.*)} }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table
- .gcc_except_table.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr)${RELOCATING+ *(.eh_frame_entry .eh_frame_entry.*)} }
+ .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame))${RELOCATING+ *(.eh_frame.*)} }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
.gnu_extab ${RELOCATING-0} : ONLY_IF_RO { *(.gnu_extab*) }
/* These sections are generated by the Sun/Oracle C++ compiler. */
- .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges
- .exception_ranges*) }
+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges${RELOCATING+*}) }
${TEXT_PLT+${PLT_NEXT_DATA+${PLT} ${OTHER_PLT_SECTIONS}}}
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. */
+ ${RELOCATING+/* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */}
${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
- ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
- ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
+ ${CREATE_SHLIB+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}
+ ${CREATE_PIE+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}
/* Exception handling */
- .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) ${RELOCATING+*(.eh_frame.*)} }
+ .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame))${RELOCATING+ *(.eh_frame.*)} }
.gnu_extab ${RELOCATING-0} : ONLY_IF_RW { *(.gnu_extab) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
- .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges${RELOCATING+*}) }
/* Thread Local Storage sections */
.tdata ${RELOCATING-0} :
{
${RELOCATING+*(.dynbss)}
*(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
- *(COMMON)
+ ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections.
- FIXME: Why do we need it? When there is no .bss section, we don't
+ FIXME: Why do we need it? When there is no .bss section, we do not
pad the .data section. */
- ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
+ . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
}
${OTHER_BSS_SECTIONS}
${LARGE_BSS_AFTER_BSS+${LARGE_BSS}}
cat <<EOF
${RELOCATING+${CREATE_SHLIB-${CREATE_PIE-${LARGE_DATA_ADDR}}}}
- ${RELOCATING+${CREATE_SHLIB+${SHLIB_LARGE_DATA_ADDR}}}
- ${RELOCATING+${CREATE_PIE+${SHLIB_LARGE_DATA_ADDR}}}
+ ${CREATE_SHLIB+${SHLIB_LARGE_DATA_ADDR}}
+ ${CREATE_PIE+${SHLIB_LARGE_DATA_ADDR}}
${LARGE_SECTIONS}
${LARGE_BSS_AFTER_BSS-${LARGE_BSS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});}
.comment 0 : { *(.comment) }
- .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
+ .gnu.build.attributes : { *(.gnu.build.attributes${RELOCATING+ .gnu.build.attributes.*}) }
EOF
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
+# Using an empty script for ld -r is better than mashing together
+# sections. This hack likely leaves ld -Ur broken.
+test -n "${RELOCATING}" || exit 0
+
# The next line should be uncommented if it is desired to link
# without libstart.o and directly enter main.
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
-${RELOCATING+ENTRY(${ENTRY})}
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
+ENTRY(${ENTRY})
/* Define memory regions. */
MEMORY
ram : ORIGIN = 4M, LENGTH = 10M
}
+EOF
+
+cat <<EOF
/* Many sections come in three flavours. There is the 'real' section,
like ".data". Then there are the per-procedure or per-variable
sections, generated by -ffunction-sections and -fdata-sections in GCC,
__INIT_START = .;
KEEP (*(.init))
__INIT_END = .;
- } > rom
+ }${RELOCATING+ > rom}
.fini :
{
__FINI_START = .;
KEEP (*(.fini))
__FINI_END = .;
- } > rom
+ }${RELOCATING+ > rom}
.jcr :
{
KEEP (*(.jcr))
- } > rom
+ }${RELOCATING+ > rom}
.text :
{
__TEXT_START = .;
*(.text) *(.text.*) *(.gnu.linkonce.t.*)
__TEXT_END = .;
- } > rom
+ }${RELOCATING+ > rom}
.rdata :
{
__RDATA_START = .;
*(.rdata_4) *(.rdata_2) *(.rdata_1) *(.rdata.*) *(.gnu.linkonce.r.*) *(.rodata*)
__RDATA_END = .;
- } > rom
+ }${RELOCATING+ > rom}
.ctor ALIGN(4) :
{
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
__CTOR_END = .;
- } > rom
+ }${RELOCATING+ > rom}
.dtor ALIGN(4) :
{
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
__DTOR_END = .;
- } > rom
+ }${RELOCATING+ > rom}
.data :
{
__DATA_START = .;
*(.data_4) *(.data_2) *(.data_1) *(.data) *(.data.*) *(.gnu.linkonce.d.*)
__DATA_END = .;
- } > ram AT > rom
+ }${RELOCATING+ > ram AT > rom}
.bss (NOLOAD) :
{
__BSS_START = .;
*(.bss_4) *(.bss_2) *(.bss_1) *(.bss) *(COMMON) *(.bss.*) *(.gnu.linkonce.b.*)
__BSS_END = .;
- } > ram
+ }${RELOCATING+ > ram}
/* You may change the sizes of the following sections to fit the actual
size your program requires.
. = ALIGN(4);
__HEAP_START = .;
. += 0x2000; __HEAP_MAX = .;
- } > ram
+ }${RELOCATING+ > ram}
.stack (NOLOAD) :
{
. = ALIGN(4);
. += 0x6000;
__STACK_START = .;
- } > ram
+ }${RELOCATING+ > ram}
.istack (NOLOAD) :
{
. = ALIGN(4);
. += 0x100;
__ISTACK_START = .;
- } > ram
+ }${RELOCATING+ > ram}
.comment 0 : { *(.comment) }
cat <<EOF
}
-__DATA_IMAGE_START = LOADADDR(.data);
+${RELOCATING+__DATA_IMAGE_START = LOADADDR(.data);}
EOF
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
+# Using an empty script for ld -r is better than mashing together
+# sections. This hack likely leaves ld -Ur broken.
+test -n "${RELOCATING}" || exit 0
+
test -z "$ENTRY" && ENTRY=_start
cat <<EOF
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. */
-
-${RELOCATING+ENTRY(${ENTRY})}
+EOF
+test -n "${RELOCATING}" && cat <<EOF
+ENTRY(${ENTRY})
MEMORY
{
ram : ORIGIN = 4M, LENGTH = 10M
}
+EOF
+
+cat <<EOF
SECTIONS
{
/* The heap is located in near memory, to suit both the near and
there. The alignment to 4 bytes is compatible for both the CR16C
bus width (2 bytes) and CR16CPlus bus width (4 bytes). */
- .text : { __TEXT_START = .; *(.text) __TEXT_END = .; } > rom
- .rdata : { __RDATA_START = .; *(.rdata_4) *(.rdata_2) *(.rdata_1) __RDATA_END = .; } > near_rom
- .ctor ALIGN(4) : { __CTOR_LIST = .; *(.ctors) __CTOR_END = .; } > near_rom
- .dtor ALIGN(4) : { __DTOR_LIST = .; *(.dtors) __DTOR_END = .; } > near_rom
- .data : { __DATA_START = .; *(.data_4) *(.data_2) *(.data_1) *(.data) __DATA_END = .; } > ram AT > rom
- .bss (NOLOAD) : { __BSS_START = .; *(.bss_4) *(.bss_2) *(.bss_1) *(.bss) *(COMMON) __BSS_END = .; } > ram
- .nrdata : { __NRDATA_START = .; *(.nrdat_4) *(.nrdat_2) *(.nrdat_1) __NRDATA_END = .; } > near_rom
- .ndata : { __NDATA_START = .; *(.ndata_4) *(.ndata_2) *(.ndata_1) __NDATA_END = .; } > near_ram AT > rom
- .nbss (NOLOAD) : { __NBSS_START = .; *(.nbss_4) *(.nbss_2) *(.nbss_1) *(.ncommon) __NBSS_END = .; } > near_ram
- .heap (NOLOAD) : { . = ALIGN(4); __HEAP_START = .; . += 0x2000; __HEAP_MAX = .; } > near_ram
- .stack (NOLOAD) : { . = ALIGN(4); . += 0x6000; __STACK_START = .; } > ram
- .istack (NOLOAD) : { . = ALIGN(2); . += 0x100; __ISTACK_START = .; } > ram
+ .text : { __TEXT_START = .; *(.text) __TEXT_END = .; }${RELOCATING+ > rom}
+ .rdata : { __RDATA_START = .; *(.rdata_4) *(.rdata_2) *(.rdata_1) __RDATA_END = .; }${RELOCATING+ > near_rom}
+ .ctor ALIGN(4) : { __CTOR_LIST = .; *(.ctors) __CTOR_END = .; }${RELOCATING+ > near_rom}
+ .dtor ALIGN(4) : { __DTOR_LIST = .; *(.dtors) __DTOR_END = .; }${RELOCATING+ > near_rom}
+ .data : { __DATA_START = .; *(.data_4) *(.data_2) *(.data_1) *(.data) __DATA_END = .; }${RELOCATING+ > ram AT > rom}
+ .bss (NOLOAD) : { __BSS_START = .; *(.bss_4) *(.bss_2) *(.bss_1) *(.bss) *(COMMON) __BSS_END = .; }${RELOCATING+ > ram}
+ .nrdata : { __NRDATA_START = .; *(.nrdat_4) *(.nrdat_2) *(.nrdat_1) __NRDATA_END = .; }${RELOCATING+ > near_rom}
+ .ndata : { __NDATA_START = .; *(.ndata_4) *(.ndata_2) *(.ndata_1) __NDATA_END = .; }${RELOCATING+ > near_ram AT > rom}
+ .nbss (NOLOAD) : { __NBSS_START = .; *(.nbss_4) *(.nbss_2) *(.nbss_1) *(.ncommon) __NBSS_END = .; }${RELOCATING+ > near_ram}
+ .heap (NOLOAD) : { . = ALIGN(4); __HEAP_START = .; . += 0x2000; __HEAP_MAX = .; }${RELOCATING+ > near_ram}
+ .stack (NOLOAD) : { . = ALIGN(4); . += 0x6000; __STACK_START = .; }${RELOCATING+ > ram}
+ .istack (NOLOAD) : { . = ALIGN(2); . += 0x100; __ISTACK_START = .; }${RELOCATING+ > ram}
}
-__DATA_IMAGE_START = LOADADDR(.data);
-__NDATA_IMAGE_START = LOADADDR(.ndata);
+${RELOCATING+__DATA_IMAGE_START = LOADADDR(.data);}
+${RELOCATING+__NDATA_IMAGE_START = LOADADDR(.ndata);}
EOF
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
+# Using an empty script for ld -r is better than mashing together
+# sections. This hack likely leaves ld -Ur broken.
+test -n "${RELOCATING}" || exit 0
+
# The next line should be uncommented if it is desired to link
# without libstart.o and directly enter main.
OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
MEMORY
{
text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE
${HEAP_MEMORY_MSP430}
}
+EOF
+
+cat <<EOF
SECTIONS
{
/* Bootloader. */
${RELOCATING+ PROVIDE (__boot_start = .) ; }
*(.bootloader)
${RELOCATING+. = ALIGN(2);}
- *(.bootloader.*)
+ ${RELOCATING+*(.bootloader.*)}
} ${RELOCATING+ > bootloader}
/* Information memory. */
{
*(.infomem)
${RELOCATING+. = ALIGN(2);}
- *(.infomem.*)
+ ${RELOCATING+*(.infomem.*)}
} ${RELOCATING+ > infomem}
/* Information memory (not loaded into MPU). */
{
*(.infomemnobits)
${RELOCATING+. = ALIGN(2);}
- *(.infomemnobits.*)
+ ${RELOCATING+*(.infomemnobits.*)}
} ${RELOCATING+ > infomemnobits}
/* Read-only sections, merged into text segment. */
/* Internal text space. */
.text :
{
- ${RELOCATING+. = ALIGN(2);}
+ ${RELOCATING+. = ALIGN(2);
*(SORT_NONE(.init))
*(SORT_NONE(.init0)) /* Start here after reset. */
*(SORT_NONE(.init1))
*(SORT_NONE(.init6)) /* C++ constructors. */
*(SORT_NONE(.init7))
*(SORT_NONE(.init8))
- *(SORT_NONE(.init9)) /* Call main(). */
+ *(SORT_NONE(.init9)) /* Call main(). */}
${CONSTRUCTING+ __ctors_start = . ; }
${CONSTRUCTING+ *(.ctors) }
${CONSTRUCTING+ *(.dtors) }
${CONSTRUCTING+ __dtors_end = . ; }
- ${RELOCATING+. = ALIGN(2);}
+ ${RELOCATING+. = ALIGN(2);
*(.lower.text.* .lower.text)
- ${RELOCATING+. = ALIGN(2);}
+ . = ALIGN(2);}
*(.text)
- ${RELOCATING+. = ALIGN(2);}
+ ${RELOCATING+. = ALIGN(2);
*(.text.*)
- ${RELOCATING+. = ALIGN(2);}
+ . = ALIGN(2);
*(.text:*)
*(.either.text.* .either.text)
- ${RELOCATING+. = ALIGN(2);}
+ . = ALIGN(2);
*(SORT_NONE(.fini9))
*(SORT_NONE(.fini8))
*(SORT_NONE(.fini7))
*(SORT_NONE(.fini0)) /* Infinite loop after program termination. */
*(SORT_NONE(.fini))
- _etext = .;
+ _etext = .;}
} ${RELOCATING+ > text}
.rodata :
{
- ${RELOCATING+. = ALIGN(2);}
+ ${RELOCATING+. = ALIGN(2);
*(.lower.rodata.* .lower.rodata)
. = ALIGN(2);
- *(.plt)
- *(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*)
- *(.rodata1)
+ *(.plt)}
+ *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.* .const .const:*})
+ ${RELOCATING+*(.rodata1)
*(.either.rodata.*) *(.either.rodata)
*(.eh_frame_hdr)
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
- KEEP (*(.dtors))
+ KEEP (*(.dtors))}
} ${RELOCATING+ > text}
.vectors ${RELOCATING-0}:
{
${RELOCATING+ PROVIDE (__vectors_start = .) ; }
- *(.vectors*)
+ *(.vectors${RELOCATING+*})
${RELOCATING+ _vectors_end = . ; }
} ${RELOCATING+ > vectors}
{
${RELOCATING+ PROVIDE (__data_start = .) ; }
${RELOCATING+ PROVIDE (__datastart = .) ; }
- ${RELOCATING+. = ALIGN(2);}
+ ${RELOCATING+. = ALIGN(2);
KEEP (*(.jcr))
*(.data.rel.ro.local) *(.data.rel.ro*)
*(.dynamic)
- ${RELOCATING+. = ALIGN(2);}
- *(.lower.data.* .lower.data)
+ . = ALIGN(2);
+ *(.lower.data.* .lower.data)}
*(.data)
- *(.data.*)
+ ${RELOCATING+*(.data.*)
*(.gnu.linkonce.d*)
KEEP (*(.gnu.linkonce.d.*personality*))
*(.data1)
*(.either.data.* .either.data)
*(.got.plt) *(.got)
- ${RELOCATING+. = ALIGN(2);}
+ . = ALIGN(2);
*(.sdata .sdata.* .gnu.linkonce.s.*)
- ${RELOCATING+. = ALIGN(2);}
- ${RELOCATING+ _edata = . ; }
- } ${RELOCATING+ > data ${RELOCATING+AT> text}}
+ . = ALIGN(2);
+ _edata = .;}
+ } ${RELOCATING+ > data AT> text}
- __romdatastart = LOADADDR(.data);
- __romdatacopysize = SIZEOF(.data);
+ ${RELOCATING+__romdatastart = LOADADDR(.data);
+ __romdatacopysize = SIZEOF(.data);}
.bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
{
${RELOCATING+. = ALIGN(2);}
${RELOCATING+ PROVIDE (__bss_start = .); }
- ${RELOCATING+ PROVIDE (__bssstart = .); }
+ ${RELOCATING+ PROVIDE (__bssstart = .);
*(.lower.bss.* .lower.bss)
- ${RELOCATING+. = ALIGN(2);}
+ . = ALIGN(2);}
*(.bss)
- *(.either.bss.* .either.bss)
+ ${RELOCATING+*(.either.bss.* .either.bss)
*(COMMON)
- ${RELOCATING+ PROVIDE (__bss_end = .) ; }
+ PROVIDE (__bss_end = .);}
} ${RELOCATING+ > data}
${RELOCATING+ PROVIDE (__bsssize = SIZEOF(.bss)); }
. $srcdir/scripttempl/DWARF.sc
-cat <<EOF
+test -n "${RELOCATING}" && cat <<EOF
.MSP430.attributes 0 :
{
KEEP (*(.MSP430.attributes))
PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ;
PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ;
PROVIDE (__subdevice_has_heap = ${GOT_HEAP_MSP-0}) ;
+EOF
+
+cat <<EOF
}
EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
MEMORY
{
text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE
vectors (rw) : ORIGIN = 0xffe0, LENGTH = 0x20
}
+EOF
+
+cat <<EOF
SECTIONS
{
/* Read-only sections, merged into text segment. */
/* Internal text space. */
.text :
{
- ${RELOCATING+. = ALIGN(2);}
+ ${RELOCATING+. = ALIGN(2);
*(SORT_NONE(.init))
*(SORT_NONE(.init0)) /* Start here after reset. */
*(SORT_NONE(.init1))
*(SORT_NONE(.init6)) /* C++ constructors. */
*(SORT_NONE(.init7))
*(SORT_NONE(.init8))
- *(SORT_NONE(.init9)) /* Call main(). */
+ *(SORT_NONE(.init9)) /* Call main(). */}
${CONSTRUCTING+ __ctors_start = . ; }
${CONSTRUCTING+ *(.ctors) }
${RELOCATING+. = ALIGN(2);}
*(.text)
- ${RELOCATING+. = ALIGN(2);}
+ ${RELOCATING+. = ALIGN(2);
*(.text.*)
- ${RELOCATING+. = ALIGN(2);}
+ . = ALIGN(2);
*(.text:*)
- ${RELOCATING+. = ALIGN(2);}
+ . = ALIGN(2);
*(SORT_NONE(.fini9))
*(SORT_NONE(.fini8))
*(SORT_NONE(.fini7))
*(SORT_NONE(.fini0)) /* Infinite loop after program termination. */
*(SORT_NONE(.fini))
- ${RELOCATING+ _etext = . ; }
+ _etext = . ;}
} ${RELOCATING+ > text}
.rodata :
{
- *(.rodata .rodata.* .gnu.linkonce.r.*)
- *(.const)
- *(.const:*)
+ *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*})
+ ${RELOCATING+*(.const)}
+ ${RELOCATING+*(.const:*)}
} ${RELOCATING+ > text}
.data ${RELOCATING-0} :
${RELOCATING+ PROVIDE (__data_start = .) ; }
${RELOCATING+. = ALIGN(2);}
*(.data)
- *(.data.*)
- *(.gnu.linkonce.d*)
+ ${RELOCATING+*(.data.*)}
+ ${RELOCATING+*(.gnu.linkonce.d*)}
${RELOCATING+. = ALIGN(2);}
${RELOCATING+ _edata = . ; }
- } ${RELOCATING+ > data ${RELOCATING+AT> text}}
+ } ${RELOCATING+ > data AT> text}
__romdatastart = LOADADDR(.data);
__romdatacopysize = SIZEOF(.data);
.vectors ${RELOCATING-0}:
{
${RELOCATING+ PROVIDE (__vectors_start = .) ; }
- *(.vectors*)
+ *(.vectors${RELOCATING+*})
${RELOCATING+ _vectors_end = . ; }
} ${RELOCATING+ > vectors}
. $srcdir/scripttempl/DWARF.sc
-cat <<EOF
+test -n "${RELOCATING}" && cat <<EOF
PROVIDE (__stack = ${STACK}) ;
PROVIDE (__data_start_rom = _etext) ;
PROVIDE (__data_end_rom = _etext + SIZEOF (.data)) ;
PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ;
PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ;
+EOF
+
+cat <<EOF
}
EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
-${RELOCATING+ENTRY ("_start")}
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
+ENTRY ("_start")
MEMORY
{
ldata : o =0x4000 ,l = 0x0200
}
+ELF
+
+cat <<EOF
SECTIONS
{
.init :
.text :
{
- *(.rodata)
- *(.text.*)
+ ${RELOCATING+*(.rodata)}
+ ${RELOCATING+*(.text.*)}
*(.text)
${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > introm}
.data :
{
*(.data)
- *(.data.*)
+ ${RELOCATING+*(.data.*)}
${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > dram}
{
${RELOCATING+ _bss_start = . ;}
*(.bss)
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
${RELOCATING+ _end = . ; }
} ${RELOCATING+ > dram}
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
-${RELOCATING+ENTRY ("_start")}
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
+ENTRY ("_start")
MEMORY
{
vectarea : o =0xc00000, l = 0x0300
ldata : o =0x4000 ,l = 0x0200
}
+EOF
+
+cat <<EOF
SECTIONS
{
/*.vects :
.text :
{
- *(.rodata)
- *(.text.*)
+ ${RELOCATING+*(.rodata)}
+ ${RELOCATING+*(.text.*)}
*(.text)
${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > introm}
.data :
{
*(.data)
- *(.data.*)
+ ${RELOCATING+*(.data.*)}
${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > dram}
{
${RELOCATING+ _bss_start = . ;}
*(.bss)
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
${RELOCATING+ _end = . ; }
} ${RELOCATING+ > dram}
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
-${RELOCATING+ENTRY ("_start")}
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
+ENTRY ("_start")
MEMORY
{
vectarea : o =0xc00000, l = 0x0300
ldata : o =0x4000 ,l = 0x0200
}
+
+EOF
+
+cat <<EOF
SECTIONS
{
/*.vects :
.text :
{
- *(.rodata)
- *(.text.*)
+ ${RELOCATING+*(.rodata)}
+ ${RELOCATING+*(.text.*)}
*(.text)
${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > introm}
.data :
{
*(.data)
- *(.data.*)
+ ${RELOCATING+*(.data.*)}
${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > dram}
{
${RELOCATING+ _bss_start = . ;}
*(.bss)
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
${RELOCATING+ _end = . ; }
} ${RELOCATING+ > dram}
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then
- GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }"
+ GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }"
else
GOT=".got ${RELOCATING-0} : { *(.got) }"
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }"
{
${RELOCATING+${SBSS_START_SYMBOLS}}
${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
- *(.dynsbss)
+ ${RELOCATING+*(.dynsbss)}
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
- *(.scommon)
+ ${RELOCATING+*(.scommon)}
${RELOCATING+${SBSS_END_SYMBOLS}}
}"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
/* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
/* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} :
{
- *(.dynbss)
- *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
- *(COMMON)
- /* Align here to ensure that the .bss section occupies space up to
- _end. Align after .bss to ensure correct alignment even if the
- .bss section disappears because there are no input sections.
- FIXME: Why do we need it? When there is no .bss section, we don't
- pad the .data section. */
- ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
+ ${RELOCATING+*(.dynbss)}
+ *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
+ ${RELOCATING+*(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we do not
+ pad the .data section. */
+ . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
}
${OTHER_BSS_SECTIONS}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
EOF
fi
cat <<EOF
- . = ALIGN(0x1000);
+ ${RELOCATING+. = ALIGN(0x1000);}
.rel.plt ${RELOCATING-0} : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) }
${OTHER_PLT_RELOC_SECTIONS}
${RELOCATING+PROVIDE (__etext = .);}
${RELOCATING+PROVIDE (_etext = .);}
${RELOCATING+PROVIDE (etext = .);}
- . = ALIGN(0x1000);
+ ${RELOCATING+. = ALIGN(0x1000);}
${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}}
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) }
- . = ALIGN(0x1000);
+ ${RELOCATING+. = ALIGN(0x1000);}
.data ${RELOCATING-0} :
{
- *(.rodata .rodata.*)
+ ${RELOCATING+*(.rodata .rodata.*)
*(.rodata1)
*(.gnu.linkonce.r.*)
- ${RELOCATING+${DATA_START_SYMBOLS}}
+ ${DATA_START_SYMBOLS}}
*(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
${CONSTRUCTING+SORT(CONSTRUCTORS)}
- KEEP (*(.eh_frame))
+ ${RELOCATING+KEEP (*(.eh_frame))
*(.gcc_except_table)
${CTOR}
${DTOR}
- KEEP (*(.jcr))
+ KEEP (*(.jcr))}
}
.data1 ${RELOCATING-0} : { *(.data1) }
- . = ALIGN(0x1000);
+ ${RELOCATING+. = ALIGN(0x1000);}
.gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) }
${WRITABLE_RODATA+${RODATA}}
${OTHER_READWRITE_SECTIONS}
${TEXT_DYNAMIC-${DYNAMIC}}
${DATA_PLT+${PLT}}
${RELOCATING+${OTHER_GOT_SYMBOLS}}
- .got ${RELOCATING-0} : { *(.got.plt) *(.got) }
+ .got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }
${OTHER_GOT_SECTIONS}
${CREATE_SHLIB+${SDATA2}}
${CREATE_SHLIB+${SBSS2}}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS}
${BSS_PLT+${PLT}}
- . = ALIGN(0x1000);
+ ${RELOCATING+. = ALIGN(0x1000);}
.bss ${RELOCATING-0} :
{
- *(.dynbss)
+ ${RELOCATING+*(.dynbss)}
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
- *(COMMON)
+ ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
- ${RELOCATING+. = ALIGN(${ALIGNMENT});}
+ . = ALIGN(${ALIGNMENT});}
}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});}
${STACK_ADDR+${STACK}}
/* Stabs debugging sections. */
- . = ALIGN(0x1000);
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
- . = ALIGN(0x1000);
.comment 0 : { *(.comment) }
EOF
fi
INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
-test -z "$GOT" && GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }"
+test -z "$GOT" && GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }"
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
{
${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);}
- *(.dynsbss)
+ ${RELOCATING+*(.dynsbss)}
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
- *(.scommon)
+ ${RELOCATING+*(.scommon)}
${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);}
}"
.jlitab ${RELOCATING-0} :
{
${RELOCATING+${JLI_START_TABLE}}
- jlitab*.o(.jlitab*)
- *(.jlitab*)
+ ${RELOCATING+jlitab*.o(.jlitab*)}
+ *(.jlitab${RELOCATING+*})
} =${NOP-0}
.text ${RELOCATING-0} :
{
${CREATE_SHLIB-${SBSS2}}
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
/* Exception handling */
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} :
{
- *(.dynbss)
- *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
- *(COMMON)
- /* Align here to ensure that the .bss section occupies space up to
- _end. Align after .bss to ensure correct alignment even if the
- .bss section disappears because there are no input sections. */
- ${RELOCATING+. = ALIGN(${ALIGNMENT});}
+ ${RELOCATING+*(.dynbss)}
+ *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
+ ${RELOCATING+*(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections. */
+ . = ALIGN(${ALIGNMENT});}
}
${OTHER_BSS_SECTIONS}
${RELOCATING+. = ALIGN(${ALIGNMENT});}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+PROVIDE (end = .);}
${RELOCATING+${DATA_SEGMENT_END}}
+EOF
+test -n "${RELOCATING}" && cat <<EOF
/* We want to be able to set a default stack / heap size in a dejagnu
board description file, but override it for selected test cases.
The options appear in the wrong order to do this with a single symbol -
ldflags comes after flags injected with per-file stanzas, and thus
the setting from ldflags prevails. */
- .heap ${RELOCATING-0} :
+ .heap :
{
- ${RELOCATING+ __start_heap = . ; }
- ${RELOCATING+ . = . + (DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : (DEFINED(__DEFAULT_HEAP_SIZE) ? __DEFAULT_HEAP_SIZE : 20k)) ; }
- ${RELOCATING+ __end_heap = . ; }
+ __start_heap = . ;
+ . = . + (DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : (DEFINED(__DEFAULT_HEAP_SIZE) ? __DEFAULT_HEAP_SIZE : 20k)) ;
+ __end_heap = . ;
}
- ${RELOCATING+. = ALIGN(0x8);}
- .stack ${RELOCATING-0} :
+ . = ALIGN(0x8);
+ .stack :
{
- ${RELOCATING+ __stack = . ; }
- ${RELOCATING+ . = . + (DEFINED(__STACK_SIZE) ? __STACK_SIZE : (DEFINED(__DEFAULT_STACK_SIZE) ? __DEFAULT_STACK_SIZE : 64k)) ; }
- ${RELOCATING+ __stack_top = . ; }
+ __stack = . ;
+ . = . + (DEFINED(__STACK_SIZE) ? __STACK_SIZE : (DEFINED(__DEFAULT_STACK_SIZE) ? __DEFAULT_STACK_SIZE : 64k)) ;
+ __stack_top = . ;
}
+EOF
+cat <<EOF
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
- .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
# If we request a big endian toolchain, give a big endian linker
-test -z "$GOT" && GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) } ${RELOCATING+ > ${DATA_MEMORY}}"
+test -z "$GOT" && GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) } ${RELOCATING+ > ${DATA_MEMORY}}"
test "${ARC_ENDIAN}" == "big" && OUTPUT_FORMAT=${BIG_OUTPUT_FORMAT}
if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
test -z "${ELFSIZE}" && ELFSIZE=32
.jcr : { KEEP (*(.jcr)) } ${RELOCATING+> ${TEXT_MEMORY}}
.eh_frame : { KEEP (*(.eh_frame)) } ${RELOCATING+> ${TEXT_MEMORY}}
- .gcc_except_table : { *(.gcc_except_table) *(.gcc_except_table.*) } ${RELOCATING+> ${TEXT_MEMORY}}
+ .gcc_except_table : { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) } ${RELOCATING+> ${TEXT_MEMORY}}
.plt : { *(.plt) } ${RELOCATING+> ${TEXT_MEMORY}}
.jlitab :
{
${RELOCATING+${JLI_START_TABLE}}
- jlitab*.o:(.jlitab*) *(.jlitab*)
+ ${RELOCATING+jlitab*.o:(.jlitab*)}
+ *(.jlitab${RELOCATING+*})
} ${RELOCATING+> ${TEXT_MEMORY}}
.rodata ${RELOCATING-0} :
line will have no effect, see PR13697. Thus, keep .data */
KEEP (*(.data))
${RELOCATING+${DATA_START_SYMBOLS}}
- *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
+ ${RELOCATING+*(.data.* .gnu.linkonce.d.*)}
${CONSTRUCTING+SORT(CONSTRUCTORS)}
} ${RELOCATING+ > ${DATA_MEMORY}}
${RELOCATING+${SBSS2}}
.bss ${RELOCATING-0} :
{
- *(.dynbss)
- *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
- *(COMMON)
- /* Align here to ensure that the .bss section occupies space up to
- _end. Align after .bss to ensure correct alignment even if the
- .bss section disappears because there are no input sections. */
- ${RELOCATING+. = ALIGN(${ALIGNMENT});}
+ ${RELOCATING+*(.dynbss)}
+ *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
+ ${RELOCATING+*(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections. */
+ . = ALIGN(${ALIGNMENT});}
${RELOCATING+_end = .;}
${RELOCATING+PROVIDE (end = .);}
} ${RELOCATING+ > ${DATA_MEMORY}}
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
- .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
+ .debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}")
OUTPUT_ARCH(${OUTPUT_ARCH})
-${RELOCATING+ENTRY(${ENTRY})}
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
+ENTRY(${ENTRY})
-${RELOCATING+${LIB_SEARCH_DIRS}}
-${RELOCATING+/* Do we need any of these for elf?
- __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
-${RELOCATING+${EXECUTABLE_SYMBOLS}}
+${LIB_SEARCH_DIRS}
+/* Do we need any of these for elf?
+ __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */
+${EXECUTABLE_SYMBOLS}
MEMORY
{
STACK : org = 0x0200BFFC, len = 4
}
+EOF
+
+cat <<EOF
SECTIONS
{
.text ${RELOCATING+${TEXT_START_ADDR}} :
{
- ${RELOCATING+${TEXT_START_SYMBOLS}}
+ ${RELOCATING+${TEXT_START_SYMBOLS}
KEEP (*(SORT_NONE(.init)))
KEEP (*(SORT_NONE(.init.*)))
KEEP (*(SORT_NONE(.fini)))
- KEEP (*(SORT_NONE(.fini.*)))
+ KEEP (*(SORT_NONE(.fini.*)))}
*(.text)
- *(.text.*)
+ ${RELOCATING+*(.text.*)}
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
- *(.gnu.linkonce.t*)
- ${RELOCATING+_etext = .;}
- ${RELOCATING+PROVIDE (etext = .);}
+ ${RELOCATING+*(.gnu.linkonce.t*)
+ _etext = .;
+ PROVIDE (etext = .);}
} ${RELOCATING+ >INSN} =${NOP-0}
.rodata ${RELOCATING+${READONLY_START_ADDR}} : {
*(.rodata)
- *(.gnu.linkonce.r*)
- *(.rodata.*)
+ ${RELOCATING+*(.gnu.linkonce.r*)
+ *(.rodata.*)}
} ${RELOCATING+ >DATA}
.rodata1 ${RELOCATING-0} : {
*(.rodata1)
- *(.rodata1.*)
+ ${RELOCATING+*(.rodata1.*)}
} ${RELOCATING+ >DATA}
.data ${RELOCATING-0} :
{
${RELOCATING+${DATA_START_SYMBOLS}}
*(.data)
- *(.data.*)
- *(.gnu.linkonce.d*)
+ ${RELOCATING+*(.data.*)
+ *(.gnu.linkonce.d*)}
${CONSTRUCTING+CONSTRUCTORS}
} ${RELOCATING+ >DATA}
.data1 ${RELOCATING-0} : {
*(.data1)
- *(.data1.*)
+ ${RELOCATING+*(.data1.*)}
} ${RELOCATING+ >DATA}
${RELOCATING+${CTOR} >DATA}
we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : {
*(.sdata)
- *(.sdata.*)
+ ${RELOCATING+*(.sdata.*)}
} ${RELOCATING+ >DATA}
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
${RELOCATING+__bss_start = .;}
- .sbss ${RELOCATING-0} : { *(.sbss) *(.scommon) } ${RELOCATING+ >DATA}
+ .sbss ${RELOCATING-0} : { *(.sbss)${RELOCATING+ *(.scommon)} } ${RELOCATING+ >DATA}
.bss ${RELOCATING-0} :
{
- *(.dynbss)
- *(.dynbss.*)
+ ${RELOCATING+*(.dynbss)
+ *(.dynbss.*)}
*(.bss)
- *(.bss.*)
- *(COMMON)
+ ${RELOCATING+*(.bss.*)
+ *(COMMON)}
} ${RELOCATING+ >DATA}
${RELOCATING+_end = . ;}
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
MEMORY
{
text ${TEXT_DEF_SECTION} : ORIGIN = ${TEXT_START_ADDR}, LENGTH = ${TEXT_SIZE}
eit : ORIGIN = ${EIT_START_ADDR}, LENGTH = ${EIT_SIZE}
}
+EOF
+
+cat <<EOF
SECTIONS
{
/* Read-only sections, merged into text segment: */
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
- .rel.text ${RELOCATING-0} : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
- .rela.text ${RELOCATING-0} : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
- .rel.data ${RELOCATING-0} : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
- .rela.data ${RELOCATING-0} : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
- .rel.rodata ${RELOCATING-0} : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
- .rela.rodata ${RELOCATING-0} : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
+ .rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.gnu.linkonce.t*}) }
+ .rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.gnu.linkonce.t*}) }
+ .rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.gnu.linkonce.d*}) }
+ .rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.gnu.linkonce.d*}) }
+ .rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.gnu.linkonce.r*}) }
+ .rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.gnu.linkonce.r*}) }
.rel.stext ${RELOCATING-0} : { *(.rel.stest) }
.rela.stext ${RELOCATING-0} : { *(.rela.stest) }
.rel.etext ${RELOCATING-0} : { *(.rel.etest) }
.text :
{
*(.text)
- *(.gnu.linkonce.t*)
+ ${RELOCATING+*(.gnu.linkonce.t*)
*(SORT_NONE(.init))
*(SORT_NONE(.fini))
- ${RELOCATING+ _etext = . ; }
+ _etext = . ;}
} ${RELOCATING+ > ${TEXT_MEMORY}}
/* Internal data space */
.data ${RELOCATING-0} :
{
*(.data)
- *(.gnu.linkonce.d*)
+ ${RELOCATING+*(.gnu.linkonce.d*)}
${CONSTRUCTING+CONSTRUCTORS}
${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > ${DATA_MEMORY}}
{
${RELOCATING+ PROVIDE (__bss_start = .) ; }
*(.bss)
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
${RELOCATING+ PROVIDE (__bss_end = .) ; }
${RELOCATING+ _end = . ; }
} ${RELOCATING+ > ${DATA_MEMORY}}
. $srcdir/scripttempl/DWARF.sc
cat <<EOF
- PROVIDE (__stack = ${STACK_START_ADDR});
+ ${RELOCATING+PROVIDE (__stack = ${STACK_START_ADDR});}
}
EOF
-
${RELOCATING+__bss_start = .;}
${RELOCATING+*(.sbss)}
${RELOCATING+*(.scommon)}
-
- *(.dynbss)
+ ${RELOCATING+*(.dynbss)}
*(.bss)
${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)}
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
${RELOCATING+PROVIDE (_end = .);}
} ${RELOCATING+ > ${DATA_MEMORY}}
${RELOCATING+__bss_size = SIZEOF(.bss);}
.eeprom ${RELOCATING-0} :
{
*(.eeprom)
- *(.eeprom.*)
+ ${RELOCATING+*(.eeprom.*)}
} ${RELOCATING+ > ${EEPROM_MEMORY}}
${RELOCATING+${VECTORS}}
${RELOCATING+*(.softregs)}
${RELOCATING+*(.sbss)}
${RELOCATING+*(.scommon)}
-
- *(.dynbss)
+ ${RELOCATING+*(.dynbss)}
*(.bss)
${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)}
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
${RELOCATING+PROVIDE (_end = .);}
} ${RELOCATING+ > ${DATA_MEMORY}}
${RELOCATING+__bss_size = SIZEOF(.bss);}
.eeprom ${RELOCATING-0} :
{
*(.eeprom)
- *(.eeprom.*)
+ ${RELOCATING+*(.eeprom.*)}
} ${RELOCATING+ > ${EEPROM_MEMORY}}
${RELOCATING+${VECTORS}}
${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING+${MEMORY_DEF}}
-PROVIDE (_start = $[$ROM_TOP - $ROM_SIZE + 1]);
+${RELOCATING+PROVIDE (_start = $[$ROM_TOP - $ROM_SIZE + 1]);}
SECTIONS
{
.hash ${RELOCATING-0} : { *(.hash) }
${RELOCATING+*(.sbss)}
${RELOCATING+*(.common)}
${RELOCATING+*(.scommon)}
-
- *(.dynbss)
+ ${RELOCATING+*(.dynbss)}
*(.bss)
${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)}
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
${RELOCATING+PROVIDE (_end = .);}
} ${RELOCATING+ > ${DATA_MEMORY}}
${RELOCATING+__bss_size = SIZEOF(.bss);}
.eeprom ${RELOCATING-0} :
{
*(.eeprom)
- *(.eeprom.*)
+ ${RELOCATING+*(.eeprom.*)}
} ${RELOCATING+ > ${EEPROM_MEMORY}}
${RELOCATING+${VECTORS}}
${RELOCATING+ENTRY (${ENTRY})}
-_TEXT_START_ADDR = DEFINED(_TEXT_START_ADDR) ? _TEXT_START_ADDR : 0x50;
+${RELOCATING+_TEXT_START_ADDR = DEFINED(_TEXT_START_ADDR) ? _TEXT_START_ADDR : 0x50;
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x0;
-_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x400;
+_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x400;}
SECTIONS
{
${RELOCATING+ _ftext = .;}
.text : {
- ${RELOCATING+*(.text)}
+ *(.text)
${RELOCATING+*(.text.*)}
${RELOCATING+*(.gnu.linkonce.t.*)}
}
${RELOCATING+ . = ALIGN(4);}
${RELOCATING+ _frodata = . ;}
.rodata : {
- ${RELOCATING+*(.rodata)}
+ *(.rodata)
${RELOCATING+*(.rodata.*)}
${RELOCATING+*(.gnu.linkonce.r.*)}
- ${CONSTRUCTING+CONSTRUCTORS}; /* Is this needed? */
+ ${CONSTRUCTING+CONSTRUCTORS;} /* Is this needed? */
}
${RELOCATING+ _erodata = .;}
${RELOCATING+. = ALIGN(8);}
${RELOCATING+ _ssrw = .;}
.sdata2 : {
- ${RELOCATING+*(.sdata2)}
+ *(.sdata2)
${RELOCATING+*(.sdata2.*)}
${RELOCATING+*(.gnu.linkonce.s2.*)}
}
${RELOCATING+. = ALIGN(4);}
.sbss2 : {
${RELOCATING+PROVIDE (__sbss2_start = .);}
- ${RELOCATING+*(.sbss2)}
+ *(.sbss2)
${RELOCATING+*(.sbss2.*)}
${RELOCATING+*(.gnu.linkonce.sb2.*)}
${RELOCATING+PROVIDE (__sbss2_end = .);}
${RELOCATING+ . = ALIGN(4);}
${RELOCATING+ _fdata = .;}
.data : {
- ${RELOCATING+*(.data)}
+ *(.data)
${RELOCATING+*(.gnu.linkonce.d.*)}
- ${CONSTRUCTING+CONSTRUCTORS}; /* Is this needed? */
+ ${CONSTRUCTING+CONSTRUCTORS;} /* Is this needed? */
}
${RELOCATING+ _edata = . ;}
/* Added to handle pic code */
.got : {
- ${RELOCATING+*(.got)}
+ *(.got)
}
.got1 : {
- ${RELOCATING+*(.got1)}
+ *(.got1)
}
.got2 : {
- ${RELOCATING+*(.got2)}
+ *(.got2)
}
/* Added by Sathya to handle C++ exceptions */
.eh_frame : {
- ${RELOCATING+*(.eh_frame)}
+ *(.eh_frame)
}
.jcr : {
- ${RELOCATING+*(.jcr)}
+ *(.jcr)
}
.gcc_except_table : {
- ${RELOCATING+*(.gcc_except_table)}
+ *(.gcc_except_table)
}
/* Alignments by 8 to ensure that _SDA_BASE_ on a word boundary */
${RELOCATING+. = ALIGN(8);}
${RELOCATING+ _ssro = .;}
.sdata : {
- ${RELOCATING+*(.sdata)}
+ *(.sdata)
${RELOCATING+*(.sdata.*)}
${RELOCATING+*(.gnu.linkonce.s.*)}
}
${RELOCATING+. = ALIGN(4);}
.sbss : {
${RELOCATING+PROVIDE (__sbss_start = .);}
- ${RELOCATING+*(.sbss)}
+ *(.sbss)
${RELOCATING+*(.sbss.*)}
${RELOCATING+*(.gnu.linkonce.sb.*)}
${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+ _fbss = .;}
.bss : {
${RELOCATING+PROVIDE (__bss_start = .);}
- ${RELOCATING+*(.bss)}
+ *(.bss)
${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)}
${RELOCATING+*(COMMON)}
${RELOCATING+. = ALIGN(. != 0 ? 4 : 1);}
${RELOCATING+PROVIDE (__bss_end = .);}
-
}
${RELOCATING+ . = ALIGN(4);}
}
.tdata : {
- ${RELOCATING+*(.tdata)}
+ *(.tdata)
${RELOCATING+*(.tdata.*)}
${RELOCATING+*(.gnu.linkonce.td.*)}
}
.tbss : {
- ${RELOCATING+*(.tbss)}
+ *(.tbss)
${RELOCATING+*(.tbss.*)}
${RELOCATING+*(.gnu.linkonce.tb.*)}
}
${RELOCATING+*(.softregs)}
${RELOCATING+*(.sbss)}
${RELOCATING+*(.scommon)}
-
- *(.dynbss)
+ ${RELOCATING+*(.dynbss)}
*(.bss)
${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)}
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
${RELOCATING+PROVIDE (_end = .);}
} ${RELOCATING+ > ${DATA_MEMORY}}
${RELOCATING+__bss_size = SIZEOF(.bss);}
.eeprom ${RELOCATING-0} :
{
*(.eeprom)
- *(.eeprom.*)
+ ${RELOCATING+*(.eeprom.*)}
} ${RELOCATING+ > ${EEPROM_MEMORY}}
${RELOCATING+${VECTORS}}
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then
- GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }"
+ GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }"
else
GOT=".got ${RELOCATING-0} : { *(.got) }"
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }"
${TINY_READONLY_SECTION}
.text ${RELOCATING-0} :
{
- *(.got.plt* .plt*)
+ ${RELOCATING+*(.got.plt* .plt*)}
${RELOCATING+${INIT_START}}
${RELOCATING+KEEP (*(.init.literal))}
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
/* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
/* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} :
{
- *(.dynbss)
- *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
- *(COMMON)
- /* Align here to ensure that the .bss section occupies space up to
- _end. Align after .bss to ensure correct alignment even if the
- .bss section disappears because there are no input sections.
- FIXME: Why do we need it? When there is no .bss section, we don't
- pad the .data section. */
- ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
+ ${RELOCATING+*(.dynbss)}
+ *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
+ ${RELOCATING+*(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections.
+ FIXME: Why do we need it? When there is no .bss section, we do not
+ pad the .data section. */
+ . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
}
${OTHER_BSS_SECTIONS}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then
- GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }"
+ GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }"
else
GOT=".got ${RELOCATING-0} : { *(.got) }"
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }"
{
${RELOCATING+${SBSS_START_SYMBOLS}}
${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
- *(.dynsbss)
+ ${RELOCATING+*(.dynsbss)}
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
- *(.scommon)
+ ${RELOCATING+*(.scommon)}
${RELOCATING+${SBSS_END_SYMBOLS}}
}"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
.sdata ${RELOCATING-0} :
{
${RELOCATING+${SDATA_START_SYMBOLS}}
- ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
+ ${RELOCATING+${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}}
*(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
}"
SDATA2=".sdata2 ${RELOCATING-0} :
${OTHER_BSS_SECTIONS}
.lbss ${RELOCATING-0} :
{
- *(.dynlbss)
+ ${RELOCATING+*(.dynlbss)}
*(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
- *(LARGE_COMMON)
+ ${RELOCATING+*(LARGE_COMMON)}
}"
test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
.lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}")
OUTPUT_ARCH(${OUTPUT_ARCH})
-${RELOCATING+ENTRY(${ENTRY})}
-
-${RELOCATING+${EXECUTABLE_SYMBOLS}}
-${RELOCATING+${INPUT_FILES}}
-${RELOCATING- /* For some reason, the Solaris linker makes bad executables
- if gld -r is used and the intermediate file has sections starting
- at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
- bug. But for now assigning the zero vmas works. */}
+EOF
+test -n "${RELOCATING}" && cat <<EOF
+ENTRY(${ENTRY})
+${EXECUTABLE_SYMBOLS}
+${INPUT_FILES}
/* BSP specific*/
__PROG_SIZE_FOR_CORE__ = 1M;
PROVIDE (__CORE_ROW_ = __FIRST_CORE_ROW_);
PROVIDE (__CORE_COL_ = __FIRST_CORE_COL_);
-/* generic don't touch */
-/* used to calculated the slice address in the external memory*/
+/* generic do not touch */
+/* used to calculated the slice address in the external memory */
__CORE_NUM_ = (__CORE_ROW_ - __FIRST_CORE_ROW_ )* __MAX_NUM_CORES_IN_COLS__ + (__CORE_COL_ - __FIRST_CORE_COL_ ) ;
}
+EOF
+cat <<EOF
SECTIONS
{
+EOF
+test -n "${RELOCATING}" && cat <<EOF
IVT 0 : {*.o(IVT) } > RESERVED_CRT0_RAM
RESERVED_CRT0 : {*.o(RESERVED_CRT0) } > RESERVED_CRT0_RAM
RESERVED_CRT0 : {*.o(reserved_crt0) } > RESERVED_CRT0_RAM
__new_lib_start_external_ = ( ORIGIN(EXTERNAL_DRAM_0) + __PROG_SIZE_FOR_CORE__ *__CORE_NUM_ );
__new_lib_start_ = DEFINED(__USE_INTERNAL_MEM_FOR_NEW_LIB_) ? ORIGIN(BANK1_SRAM) : __new_lib_start_external_ ;
- NEW_LIB_RO ${RELOCATING+__new_lib_start_} : { lib_a-*.o(.text .rodata ) *.o(libgloss_epiphany) } /* > INTERNAL_RAM*/
+ NEW_LIB_RO __new_lib_start_ : { lib_a-*.o(.text .rodata) *.o(libgloss_epiphany) } /* > INTERNAL_RAM */
GNU_C_BUILTIN_LIB_RO ADDR(NEW_LIB_RO) + SIZEOF(NEW_LIB_RO) : {
*mulsi3.o(.text .rodata) *modsi3.o(.text .rodata)
*divsi3.o(.text .rodata) *udivsi3.o(.text .rodata)
__init_start = DEFINED(__USE_INTERNAL_MEM_) ? ORIGIN(BANK1_SRAM) : (ADDR(NEW_LIB_WR) + SIZEOF(NEW_LIB_WR) ) ;
__init_start = DEFINED(__USE_INTERNAL_MEM_FOR_NEW_LIB_) ? ADDR(NEW_LIB_WR) + SIZEOF(NEW_LIB_WR) : __init_start;
+EOF
-
+cat <<EOF
/* Read-only sections, merged into text segment: */
/*${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}*/
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
cat <<EOF
- .init __init_start :
+ .init ${RELOCATING+__init_start} :
{
${RELOCATING+${INIT_START}}
KEEP (*(.init))
${RELOCATING+${INIT_END}}
- } /*> INTERNAL_RAM*/ =${NOP-0}
+ } /* ${RELOCATING+ > INTERNAL_RAM} */ =${NOP-0}
${TEXT_PLT+${PLT}}
${TINY_READONLY_SECTION}
${RELOCATING+${FINI_START}}
KEEP (*(.fini))
${RELOCATING+${FINI_END}}
- } /*> INTERNAL_RAM*/ =${NOP-0}
+ } /* ${RELOCATING+ > INTERNAL_RAM} */ =${NOP-0}
.text ${RELOCATING+ADDR(.fini)+SIZEOF(.fini)} ${RELOCATING-0} :
{
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
${RELOCATING+${OTHER_TEXT_SECTIONS}}
- } /*> INTERNAL_RAM */ =${NOP-0}
+ } /* ${RELOCATING+ > INTERNAL_RAM} */ =${NOP-0}
${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);}
${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
/* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
/* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
.init_array ${RELOCATING-0} :
{
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}}
- KEEP (*(SORT(.init_array.*)))
+ ${RELOCATING+KEEP (*(SORT(.init_array.*)))}
KEEP (*(.init_array))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}}
}
{
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}}
KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
+ ${RELOCATING+KEEP (*(SORT(.fini_array.*)))}
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}}
}
${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
${RELOCATING+${DATA_START_SYMBOLS}}
*(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
${CONSTRUCTING+SORT(CONSTRUCTORS)}
- } /*> INTERNAL_RAM*/
+ } /* ${RELOCATING+ > INTERNAL_RAM} */
.data1 ${RELOCATING-0} : { *(.data1) }
${WRITABLE_RODATA+${RODATA}}
${OTHER_READWRITE_SECTIONS}
${BSS_PLT+${PLT}}
.bss ${RELOCATING+ADDR(.rodata)+SIZEOF(.rodata)} ${RELOCATING-0} :
{
- *(.dynbss)
+ ${RELOCATING+*(.dynbss)}
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
- *(COMMON)
+ ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections.
- FIXME: Why do we need it? When there is no .bss section, we don't
+ FIXME: Why do we need it? When there is no .bss section, we do not
pad the .data section. */
- ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
- } /*> INTERNAL_RAM*/
+ . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
+ } /* ${RELOCATING+ > INTERNAL_RAM} */
${OTHER_BSS_SECTIONS}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});}
${RELOCATING+${END_SYMBOLS-${USER_LABEL_PREFIX}_end = .; PROVIDE (${USER_LABEL_PREFIX}end = .);}}
${RELOCATING+${DATA_SEGMENT_END}}
- PROVIDE ( __stack_start_ = ORIGIN(EXTERNAL_DRAM_0) + __PROG_SIZE_FOR_CORE__ * __CORE_NUM_ + __PROG_SIZE_FOR_CORE__ - 0x10) ;
+ ${RELOCATING+PROVIDE ( __stack_start_ = ORIGIN(EXTERNAL_DRAM_0) + __PROG_SIZE_FOR_CORE__ * __CORE_NUM_ + __PROG_SIZE_FOR_CORE__ - 0x10) ;}
.stack ${RELOCATING+__stack_start_} : { ${RELOCATING+___stack = .;} *(.stack) }
- PROVIDE ( ___heap_start = ORIGIN(EXTERNAL_DRAM_1) + __HEAP_SIZE_FOR_CORE__ * __CORE_NUM_ );
- PROVIDE ( ___heap_end = ORIGIN(EXTERNAL_DRAM_1) + __HEAP_SIZE_FOR_CORE__ * __CORE_NUM_ + __HEAP_SIZE_FOR_CORE__ - 4 );
+ ${RELOCATING+PROVIDE ( ___heap_start = ORIGIN(EXTERNAL_DRAM_1) + __HEAP_SIZE_FOR_CORE__ * __CORE_NUM_ );}
+ ${RELOCATING+PROVIDE ( ___heap_end = ORIGIN(EXTERNAL_DRAM_1) + __HEAP_SIZE_FOR_CORE__ * __CORE_NUM_ + __HEAP_SIZE_FOR_CORE__ - 4 );}
EOF
if test -n "${NON_ALLOC_DYN}"; then
*(.dtors)
___dtors_end = . ;
. = ALIGN(4);
- } > ram"
+ } ${RELOCATING+ > ram}"
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
${LIB_SEARCH_DIRS}
+EOF
+test -n "${RELOCATING}" && cat <<EOF
/* Allow the command line to override the memory region sizes. */
__PMSIZE = DEFINED(__PMSIZE) ? __PMSIZE : 256K;
__RAMSIZE = DEFINED(__RAMSIZE) ? __RAMSIZE : 64K;
flash (rx) : ORIGIN = 0, LENGTH = __PMSIZE
ram (rw!x) : ORIGIN = 0x800000, LENGTH = __RAMSIZE
}
+EOF
+cat <<EOF
SECTIONS
{
.text :
{
- *(.text*)
- *(.strings)
+ *(.text${RELOCATING+*})
+ ${RELOCATING+*(.strings)
*(._pm*)
*(.init)
*(.fini)
- ${RELOCATING+ _etext = . ; }
- . = ALIGN(4);
+ _etext = .;
+ . = ALIGN(4);}
} ${RELOCATING+ > flash}
${CONSTRUCTING+${TORS}}
.data : ${RELOCATING+ AT (ADDR (.text) + SIZEOF (.text))}
{
*(.data)
- *(.rodata)
+ ${RELOCATING+*(.rodata)
*(.rodata*)
- ${RELOCATING+ _edata = . ; }
- . = ALIGN(4);
+ _edata = .;
+ . = ALIGN(4);}
} ${RELOCATING+ > ram}
.bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
{
${RELOCATING+ _bss_start = . ; }
*(.bss)
- *(COMMON)
- ${RELOCATING+ _end = . ; }
- . = ALIGN(4);
+ ${RELOCATING+*(COMMON)
+ _end = .;
+ . = ALIGN(4);}
} ${RELOCATING+ > ram}
${RELOCATING+ __data_load_start = LOADADDR(.data); }
{
.text 0x1000 ${RELOCATING++${TEXT_START_ADDR}}:
{
- ${RELOCATING+__text_start = .};
- CREATE_OBJECT_SYMBOLS
+ ${RELOCATING+__text_start = .;
+ CREATE_OBJECT_SYMBOLS}
*(.PARISC.stubs)
*(.text)
- ${RELOCATING+etext = .};
- ${RELOCATING+_etext = .};
+ ${RELOCATING+etext = .;
+ _etext = .;}
}
${RELOCATING+. = ${DATA_ADDR};}
.data :
{
- ${RELOCATING+ . = . + 0x1000 };
- ${RELOCATING+__data_start = .};
+ ${RELOCATING+. = . + 0x1000;
+ __data_start = .;}
*(.data)
${CONSTRUCTING+CONSTRUCTORS}
- ${RELOCATING+edata = .};
- ${RELOCATING+_edata = .};
+ ${RELOCATING+edata = .;
+ _edata = .;}
}
${RELOCATING+. = ${DATA_ADDR} + SIZEOF(.data);}
.bss :
{
*(.bss)
- *(COMMON)
- ${RELOCATING+end = . };
- ${RELOCATING+_end = . };
+ ${RELOCATING+*(COMMON)
+ end = .;
+ _end = .;}
}
}
EOF
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
+# Using an empty script for ld -r is better than mashing together
+# sections. This hack likely leaves ld -Ur broken.
+test -n "${RELOCATING}" || exit 0
+
PAGESIZE=0x10000
BLOCKSIZE=0x200
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
+# Using an empty script for ld -r is better than mashing together
+# sections. This hack likely leaves ld -Ur broken.
+test -n "${RELOCATING}" || exit 0
cat << EOF
/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
{
${RELOCATING+PROVIDE (__eh_frame_begin = .);}
*(.eh_frame)
- LONG (0);
+ ${RELOCATING+LONG (0);}
${RELOCATING+PROVIDE (__eh_frame_end = .);}
- } ${RELOCATING+}
+ }
.gcc_except_table : { *(.gcc_except_table) }
${INITIAL_READONLY_SECTIONS}
.hash ${RELOCATING-0} : { *(.hash) }
.jcr : { KEEP (*(.jcr)) }
${DATA_PLT+${PLT}}
${RELOCATING+${OTHER_GOT_SYMBOLS}}
- .got ${RELOCATING-0} : { *(.got.plt) *(.got) }
+ .got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }
${RELOCATING+${OTHER_GOT_SECTIONS}}
${CREATE_SHLIB+${SDATA2}}
${CREATE_SHLIB+${SBSS2}}
{
${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);}
- *(.dynsbss)
+ ${RELOCATING+*(.dynsbss)}
*(.sbss)
${RELOCATING+*(.sbss.*)}
${RELOCATING+*(.gnu.linkonce.sb.*)}
- *(.scommon)
+ ${RELOCATING+*(.scommon)}
${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);}
}
${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} :
{
- *(.dynbss)
+ ${RELOCATING+*(.dynbss)}
*(.bss)
${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)}
- *(COMMON)
+ ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
- ${RELOCATING+. = ALIGN(${ALIGNMENT});}
+ . = ALIGN(${ALIGNMENT});}
}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});}
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then
- GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }"
+ GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }"
else
GOT=".got ${RELOCATING-0} : { *(.got) }"
GOTPLT="${RELOCATING+${DATA_SEGMENT_RELRO_GOTPLT_END}}
${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);}
${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
- *(.dynsbss)
+ ${RELOCATING+*(.dynsbss)}
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
- *(.scommon)
+ ${RELOCATING+*(.scommon)}
${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);}
}"
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table${RELOCATING+ .gcc_except_table.*})) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
/* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table${RELOCATING+ .gcc_except_table.*})) }
/* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} :
{
- *(.dynbss)
+ ${RELOCATING+*(.dynbss)}
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
- *(COMMON)
+ ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
- ${RELOCATING+. = ALIGN(${ALIGNMENT});}
+ . = ALIGN(${ALIGNMENT});}
}
${OTHER_BSS_SECTIONS}
${RELOCATING+. = ALIGN(${ALIGNMENT});}
*(.MMIX.reg_contents);
}
- /* By default, put the high end of the stack where the register stack
+ ${RELOCATING+/* By default, put the high end of the stack where the register stack
begins. They grow in opposite directions. */
- PROVIDE (__Stack_start = 0x6000000000000000);
+ PROVIDE (__Stack_start = 0x6000000000000000);}
/* Unfortunately, stabs are not mappable from ELF to MMO.
It can probably be fixed with some amount of work. */
fi
if test -z "$PLT"; then
IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }"
- PLT=".plt ${RELOCATING-0} : { *(.plt)${IREL_IN_PLT+ *(.iplt)} }
+ PLT=".plt ${RELOCATING-0} : { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} }
${IREL_IN_PLT-$IPLT}"
fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=
if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then
- GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }"
+ GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt) *(.igot.plt)} *(.got)${RELOCATING+ *(.igot)} }"
else
- GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }"
- GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }"
+ GOT=".got ${RELOCATING-0} : { *(.got)${RELOCATING+ *(.igot)} }"
+ GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt)${RELOCATING+ *(.igot.plt)} }"
fi
fi
REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }"
SBSS=".sbss_b ${RELOCATING-0} :
{
*(.sbss_b${RELOCATING+ .sbss_b.*})
- *(.scommon_b${RELOCATING+ .scommon_b.*})
+ ${RELOCATING+*(.scommon_b .scommon_b.*)}
${RELOCATING+. = ALIGN(2);}
}
.sbss_h ${RELOCATING-0} :
{
*(.sbss_h${RELOCATING+ .sbss_h.*})
- *(.scommon_h${RELOCATING+ .scommon_h.*})
+ ${RELOCATING+*(.scommon_h .scommon_h.*)}
${RELOCATING+. = ALIGN(4);}
}
.sbss_w ${RELOCATING-0} :
{
*(.sbss_w${RELOCATING+ .sbss_w.*})
- *(.scommon_w${RELOCATING+ .scommon_w.*})
+ ${RELOCATING+*(.scommon_w .scommon_w.*)
*(.dynsbss)
*(.scommon)
- ${RELOCATING+. = ALIGN(8);}
+ . = ALIGN(8);}
}
.sbss_d ${RELOCATING-0} :
{
*(.sbss_d${RELOCATING+ .sbss_d.*})
- *(.scommon_d${RELOCATING+ .scommon_d.*})
+ ${RELOCATING+*(.scommon_d .scommon_d.*)}
${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);}
}"
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table
- .gcc_except_table.*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
/* These sections are generated by the Sun/Oracle C++ compiler. */
- .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges
- .exception_ranges*) }
+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges${RELOCATING+*}) }
${TEXT_PLT+${PLT_NEXT_DATA+${PLT}}}
/* Adjust the address for the data segment. We want to adjust up to
/* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
- .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
- .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
+ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
+ .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges${RELOCATING+*}) }
/* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
${BSS_PLT+${PLT}}
.${BSS_NAME} ${RELOCATING-0} :
{
- *(.dyn${BSS_NAME})
+ ${RELOCATING+*(.dyn${BSS_NAME})}
*(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
- *(COMMON)
+ ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections.
- FIXME: Why do we need it? When there is no .bss section, we don't
+ FIXME: Why do we need it? When there is no .bss section, we do not
pad the .data section. */
- ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
+ . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
}
${OTHER_BSS_SECTIONS}
${LARGE_BSS_AFTER_BSS+${LARGE_BSS}}
OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
MEMORY
{
imem (x) : ORIGIN = $TEXT_ORIGIN, LENGTH = $TEXT_LENGTH
__HEAP_SIZE = DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : 32;
__STACK_SIZE = DEFINED(__STACK_SIZE) ? __STACK_SIZE : 512;
-${RELOCATING+ PROVIDE (_stack_top = ORIGIN(dmem) + LENGTH(dmem)) ; }
+PROVIDE (_stack_top = ORIGIN(dmem) + LENGTH(dmem));
+
+ENTRY (_start)
-${RELOCATING+ENTRY (_start)}
+EOF
+cat <<EOF
SECTIONS
{
/* Read-only sections, merged into text segment: */
${CONSTRUCTING+ KEEP (*(.fini_array))}
${CONSTRUCTING+ __fini_array_end = . ; }
- /* DATA memory starts at address 0. So to avoid placing a valid static
+ ${RELOCATING+/* DATA memory starts at address 0. So to avoid placing a valid static
variable at the invalid NULL address, we introduce the .data.atzero
section. If CRT can make some use of it - great. Otherwise skip a
word. In all cases .data/.bss sections must start at non-zero. */
- . += (. == 0 ? 4 : 0);
+ . += (. == 0 ? 4 : 0);}
${RELOCATING+ PROVIDE (_data_start = .) ; }
*(.data)
.resource_table ${RELOCATING-0} :
{
- *(.resource_table)
KEEP (*(.resource_table))
- } > dmem
+ } ${RELOCATING+ > dmem}
.bss ${RELOCATING-0} :
{
${RELOCATING+ *(.bss.*)}
${RELOCATING+ *(.bss:*)}
${RELOCATING+*(.gnu.linkonce.b*)}
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
${RELOCATING+ PROVIDE (_bss_end = .) ; }
} ${RELOCATING+ > dmem}
${RELOCATING+ PROVIDE (_noinit_end = .) ; }
${RELOCATING+ PROVIDE (_heap_start = .) ; }
${RELOCATING+ . += __HEAP_SIZE ; }
- /* Stack is not here really. It will be put at the end of DMEM.
+ ${RELOCATING+/* Stack is not here really. It will be put at the end of DMEM.
But we take into account its size here, in order to allow
- for MEMORY overflow checking during link time. */
+ for MEMORY overflow checking during link time. */}
${RELOCATING+ . += __STACK_SIZE ; }
} ${RELOCATING+ > dmem}
___dtors = . ;
*(.dtors)
___dtors_end = . ;
- } > ram"
+ }${RELOCATING+ > ram}"
cat <<EOF
/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
MEMORY
{
ram : o = 0x1000, l = 512k
}
+EOF
+
+cat <<EOF
SECTIONS
{
.text :
.zdata ${ZDATA_START_ADDR} :
{
*(.zdata)
- *(.zbss)
+ ${RELOCATING+*(.zbss)
*(reszdata)
- *(.zcommon)
+ *(.zcommon)}
}
/* This is the read only part of the zero data area.
.rozdata ${ROZDATA_START_ADDR} :
{
*(.rozdata)
- *(romzdata)
- *(romzbss)
+ ${RELOCATING+*(romzdata)
+ *(romzbss)}
}
/* Read-only sections, merged into text segment. */
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
- *(.gnu.linkonce.t*)
+ ${RELOCATING+*(.gnu.linkonce.t*)}
} =0
${RELOCATING+_etext = .;}
}
.fini : { KEEP (*(.fini)) } =0
- .rodata : { *(.rodata) ${RELOCATING+*(.rodata.*)} *(.gnu.linkonce.r*) }
+ .rodata : { *(.rodata) ${RELOCATING+*(.rodata.*) *(.gnu.linkonce.r*)} }
.rodata1 : { *(.rodata1) }
.data :
{
*(.data)
- ${RELOCATING+*(.data.*)}
- *(.gnu.linkonce.d*)
- CONSTRUCTORS
+ ${RELOCATING+*(.data.*)
+ *(.gnu.linkonce.d*)}
+ ${CONSTRUCTING+CONSTRUCTORS}
}
.data1 : { *(.data1) }
.ctors :
{
${CONSTRUCTING+___ctors = .;}
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
+ ${RELOCATING+KEEP (*(SORT(.ctors.*)))}
KEEP (*crtend(.ctors))
${CONSTRUCTING+___ctors_end = .;}
}
{
${CONSTRUCTING+___dtors = .;}
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
+ ${RELOCATING+KEEP (*(SORT(.dtors.*)))}
KEEP (*crtend.o(.dtors))
${CONSTRUCTING+___dtors_end = .;}
}
.gcc_except_table : { *(.gcc_except_table) }
- .got : { *(.got.plt) *(.got) }
+ .got : {${RELOCATING+ *(.got.plt)} *(.got) }
.dynamic : { *(.dynamic) }
.tdata ${TDATA_START_ADDR} :
{
- ${RELOCATING+PROVIDE (__ep = .);}
+ ${RELOCATING+PROVIDE (__ep = .);
*(.tbyte)
- *(.tcommon_byte)
+ *(.tcommon_byte)}
*(.tdata)
- *(.tbss)
- *(.tcommon)
+ ${RELOCATING+*(.tbss)
+ *(.tcommon)}
}
/* We want the small data sections together, so single-instruction offsets
{
${RELOCATING+__sbss_start = .;}
*(.sbss)
- *(.scommon)
+ ${RELOCATING+*(.scommon)}
}
${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;}
{
${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;}
${RELOCATING+__real_bss_start = . ;}
- *(.dynbss)
+ ${RELOCATING+*(.dynbss)}
*(.bss)
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
}
${RELOCATING+_end = . ;}
.zdata ${ZDATA_START_ADDR} :
{
*(.zdata)
- *(.zdata23)
+ ${RELOCATING+*(.zdata23)
*(.zbss)
*(.zbss23)
*(reszdata)
- *(.zcommon)
+ *(.zcommon)}
}
/* This is the read only part of the zero data area.
.rozdata ${ROZDATA_START_ADDR} :
{
*(.rozdata)
- *(romzdata)
+ ${RELOCATING+*(romzdata)
*(romzbss)
*(.zconst)
- *(.zconst23)
+ *(.zconst23)}
}
/* Read-only sections, merged into text segment. */
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
- *(.gnu.linkonce.t*)
+ ${RELOCATING+*(.gnu.linkonce.t*)}
} =0
${RELOCATING+_etext = .;}
.rodata :
{
*(.rodata)
- ${RELOCATING+*(.rodata.*)}
+ ${RELOCATING+*(.rodata.*)
*(.gnu.linkonce.r*)
- *(.const)
+ *(.const)}
}
.rodata1 : { *(.rodata1) }
.data :
{
*(.data)
- ${RELOCATING+*(.data.*)}
- *(.gnu.linkonce.d*)
- CONSTRUCTORS
+ ${RELOCATING+*(.data.*)
+ *(.gnu.linkonce.d*)}
+ ${CONSTRUCTING+CONSTRUCTORS}
}
.data1 : { *(.data1) }
.ctors :
{
${CONSTRUCTING+___ctors = .;}
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
+ ${RELOCATING+KEEP (*(SORT(.ctors.*)))}
KEEP (*crtend(.ctors))
${CONSTRUCTING+___ctors_end = .;}
}
{
${CONSTRUCTING+___dtors = .;}
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
+ ${RELOCATING+KEEP (*(SORT(.dtors.*)))}
KEEP (*crtend.o(.dtors))
${CONSTRUCTING+___dtors_end = .;}
}
.gcc_except_table : { *(.gcc_except_table) }
- .got : { *(.got.plt) *(.got) }
+ .got : {${RELOCATING+ *(.got.plt)} *(.got) }
.dynamic : { *(.dynamic) }
.tdata ${TDATA_START_ADDR} :
{
- ${RELOCATING+PROVIDE (__ep = .);}
+ ${RELOCATING+PROVIDE (__ep = .);
*(.edata)
*(.edata23)
*(.tbyte)
- *(.tcommon_byte)
+ *(.tcommon_byte)}
*(.tdata)
- *(.tdata*)
+ ${RELOCATING+*(.tdata*)
*(.ebss)
*(.ebss23)
*(.tbss)
*(.tbss*)
- *(.tcommon)
+ *(.tcommon)}
}
/* We want the small data sections together, so single-instruction offsets
{
${RELOCATING+PROVIDE (__gp = . + 0x8000);}
*(.sdata)
- *(.sdata23)
+ ${RELOCATING+*(.sdata23)}
}
/* See comment about .rozdata. */
.rosdata ${ROSDATA_START_ADDR} :
{
*(.rosdata)
- *(.sconst)
- *(.sconst23)
+ ${RELOCATING+*(.sconst)
+ *(.sconst23)}
}
/* We place the .sbss data section AFTER the .rosdata section, so that
{
${RELOCATING+__sbss_start = .;}
*(.sbss)
- *(.sbss23)
- *(.scommon)
+ ${RELOCATING+*(.sbss23)
+ *(.scommon)}
}
${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;}
{
${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;}
${RELOCATING+__real_bss_start = . ;}
- *(.dynbss)
+ ${RELOCATING+*(.dynbss)}
*(.bss)
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
}
${RELOCATING+_end = . ;}
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
ENTRY(${ENTRY})
+EOF
+test -n "${RELOCATING}" && cat <<EOF
/* Start and end of main stack. Assumes 256K of RAM. */
-${RELOCATING+ _estack = 0xe0040000 - 4;}
-${RELOCATING+ _sstack = 0xe0040000 - 64K;}
+_estack = 0xe0040000 - 4;
+_sstack = 0xe0040000 - 64K;
/* End of heap. */
-${RELOCATING+ _eheap = _sstack - 4;}
-
+_eheap = _sstack - 4;
MEMORY
{
saferam : ORIGIN = 0xf0000000, LENGTH = 0x10000000
}
+EOF
+cat <<EOF
SECTIONS
{
.init ${RELOCATING-0} : {
KEEP (*(.init))
- KEEP (*(.fini))
+ ${RELOCATING+KEEP (*(.fini))}
${RELOCATING+ _einit = .;}
} ${RELOCATING+ > init}
end of ctors marker and it must be last. */
KEEP (*(EXCLUDE_FILE (*crtend*.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
+ ${RELOCATING+KEEP (*(SORT(.ctors.*)))}
KEEP (*(.ctors))
${CONSTRUCTING+ __CTOR_END__ = .;}
} ${RELOCATING+ > rom}
${CONSTRUCTING+ __DTOR_LIST__ = .;}
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
+ ${RELOCATING+KEEP (*(SORT(.dtors.*)))}
KEEP (*(.dtors))
${CONSTRUCTING+ __DTOR_END__ = .;}
} ${RELOCATING+ > rom}
.rodata ${RELOCATING-0} : {
${RELOCATING+ . = ALIGN(4);}
${RELOCATING+ _srdata = .;}
- *(.rdata)
+ ${RELOCATING+*(.rdata)}
*(.rodata)
${RELOCATING+*(.rodata.*)}
${RELOCATING+*(.gnu.linkonce.r.*)}
*(.bss)
${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)}
- *(COMMON)
+ ${RELOCATING+*(COMMON)}
${RELOCATING+ . = ALIGN(4);}
${RELOCATING+ __bss_end = .;}
${RELOCATING+ _sheap = .;}
cat <<EOF
}
-
+${RELOCATING+
/* Provide a default address for the simulated file-I/O device. */
PROVIDE (_sim_fileio_register = 0x2fff0000);
PROVIDE (_sim_cmdline_header = 0x2ffe0000);
/* Provide a default address for the simulated 1 MHz clock. */
-PROVIDE (_sim_clock = 0x20002100);
+PROVIDE (_sim_clock = 0x20002100);}
EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}")
OUTPUT_ARCH(${OUTPUT_ARCH})
-${RELOCATING+ENTRY(${ENTRY})}
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
+ENTRY(${ENTRY})
-${RELOCATING+${LIB_SEARCH_DIRS}}
-${RELOCATING+${EXECUTABLE_SYMBOLS}}
-${RELOCATING+${INPUT_FILES}}
-${RELOCATING- /* For some reason, the Solaris linker makes bad executables
- if gld -r is used and the intermediate file has sections starting
- at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
- bug. But for now assigning the zero vmas works. */}
+${LIB_SEARCH_DIRS}
+${EXECUTABLE_SYMBOLS}
+${INPUT_FILES}
/* There are two memory regions we care about, one from 0 through 0x7F00
that is RAM and one from 0x8000 up which is ROM. */
RAM (w) : ORIGIN = 0, LENGTH = 0x7F00
ROM (!w) : ORIGIN = 0x8000, LENGTH = 0xFF8000
}
+EOF
+cat <<EOF
SECTIONS
{
.data ${RELOCATING-0} :
${RELOCATING+*(.data.*)}
${RELOCATING+*(.gnu.linkonce.d.*)}
${CONSTRUCTING+SORT(CONSTRUCTORS)}
- } > RAM
+ }${RELOCATING+ > RAM}
${RELOCATING+${OTHER_READWRITE_SECTIONS}}
${RELOCATING+${OTHER_GOT_SYMBOLS}}
${RELOCATING+${OTHER_GOT_SECTIONS}}
${RELOCATING+${OTHER_BSS_SYMBOLS}}
.bss ${RELOCATING-0} :
{
- *(.dynbss)
+ ${RELOCATING+*(.dynbss)}
*(.bss)
${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)}
- *(COMMON)
+ ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
- ${RELOCATING+. = ALIGN(${ALIGNMENT});}
- } > RAM
+ . = ALIGN(${ALIGNMENT});}
+ }${RELOCATING+ > RAM}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});}
${RELOCATING+${OTHER_END_SYMBOLS}}
${RELOCATING+PROVIDE (end = .);}
/* Read-only sections in ROM. */
- .int_vec ${RELOCATING-0} : { *(.int_vec) } ${RELOCATING+> ROM}
+ .int_vec ${RELOCATING-0} : { *(.int_vec) }${RELOCATING+ > ROM}
- .rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} } ${RELOCATING+> ROM}
+ .rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} }${RELOCATING+ > ROM}
${RELOCATING+${CTOR}}
${RELOCATING+${DTOR}}
- .jcr : { KEEP (*(.jcr)) } ${RELOCATING+> ROM}
- .eh_frame : { KEEP (*(.eh_frame)) } ${RELOCATING+> ROM}
- .gcc_except_table : { *(.gcc_except_table) *(.gcc_except_table.*) } ${RELOCATING+> ROM}
- .plt : { *(.plt) } ${RELOCATING+> ROM}
+ .jcr : { KEEP (*(.jcr)) }${RELOCATING+ > ROM}
+ .eh_frame : { KEEP (*(.eh_frame)) }${RELOCATING+ > ROM}
+ .gcc_except_table : { *(.gcc_except_table)${RELOCATING+ *(.gcc_except_table.*)} }${RELOCATING+ > ROM}
+ .plt : { *(.plt) }${RELOCATING+ > ROM}
.text ${RELOCATING-0} :
{
*(.gnu.warning)
${RELOCATING+*(.gnu.linkonce.t.*)}
${RELOCATING+${OTHER_TEXT_SECTIONS}}
- } ${RELOCATING+> ROM =${NOP-0}}
+ }${RELOCATING+ > ROM =${NOP-0}}
.init ${RELOCATING-0} :
{
${RELOCATING+${INIT_START}}
KEEP (*(.init))
${RELOCATING+${INIT_END}}
- } ${RELOCATING+> ROM =${NOP-0}}
+ }${RELOCATING+ > ROM =${NOP-0}}
.fini ${RELOCATING-0} :
{
${RELOCATING+${FINI_START}}
KEEP (*(.fini))
${RELOCATING+${FINI_END}}
- } ${RELOCATING+> ROM =${NOP-0}}
+ }${RELOCATING+ > ROM =${NOP-0}}
${RELOCATING+PROVIDE (__etext = .);}
${RELOCATING+PROVIDE (_etext = .);}
${RELOCATING+PROVIDE (etext = .);}
#source: ../../../binutils/testsuite/binutils-all/group.s
#ld: -r
#readelf: -Sg --wide
-#xfail: cr16-*-* crx-*-* xstormy*-*-*
-# cr16 and crx use non-standard scripts with memory regions, which don't play
-# well with unique group sections under ld -r.
-# xstormy also uses a non-standard script, putting .data before .text.
+# xstormy uses a non-standard script, putting .data before .text.
+#xfail: xstormy*-*-*
#...
\[[ 0-9]+\] \.group[ \t]+GROUP[ \t]+.*
#source: ../../../binutils/testsuite/binutils-all/group-2.s
#ld: -r
#readelf: -Sg --wide
-#xfail: cr16-*-* crx-*-* xstormy*-*-*
-# cr16 and crx use non-standard scripts with memory regions, which don't play
-# well with unique group sections under ld -r.
-# xstormy also uses a non-standard script, putting .data before .text.
+# xstormy uses a non-standard script, putting .data before .text.
+#xfail: xstormy*-*-*
#...
\[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.*
#source: ../../../binutils/testsuite/binutils-all/group-3.s
#ld: -r
#readelf: -Sg --wide
-#xfail: cr16-*-* crx-*-* xstormy*-*-*
-# cr16 and crx use non-standard scripts with memory regions, which don't play
-# well with unique group sections under ld -r.
-# xstormy also uses a non-standard script, putting .data before .text.
+# xstormy uses a non-standard script, putting .data before .text.
+#xfail: xstormy*-*-*
#...
\[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.*
#source: ../../../binutils/testsuite/binutils-all/group-4.s
#ld: -r
#readelf: -Sg --wide
-#xfail: cr16-*-* crx-*-* xstormy*-*-*
-# cr16 and crx use non-standard scripts with memory regions, which don't play
-# well with unique group sections under ld -r.
-# xstormy also uses a non-standard script, putting .data before .text.
+# xstormy uses a non-standard script, putting .data before .text.
+#xfail: xstormy*-*-*
#...
\[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.*
#source: ../../../binutils/testsuite/binutils-all/group-4.s
#ld: -r
#readelf: -g --wide
-#xfail: cr16-*-* crx-*-*
-# cr16 and crx use non-standard scripts with memory regions, which don't play
-# well with unique group sections under ld -r.
#...
COMDAT group section \[[ 0-9]+\] `\.group' \[foo_group\] contains . sections:
#source: group8.s
#ld: -r --gc-sections --entry foo
#readelf: -g --wide
-#xfail: cr16-*-* crx-*-* d30v-*-* dlx-*-* hppa64-*-*
-#xfail: mep-*-* mn10200-*-* pj*-*-* pru-*-* xgate-*-*
# generic linker targets don't support --gc-sections, nor do a bunch of others
-# cr16 and crx use non-standard scripts with memory regions, which don't play
-# well with unique group sections under ld -r.
+#xfail: d30v-*-* dlx-*-* hppa64-*-*
+#xfail: mep-*-* mn10200-*-* pj*-*-* pru-*-* xgate-*-*
COMDAT group section \[[ 0-9]+\] `.group' \[foo\] contains . sections:
\[Index\] Name
#source: group8.s
#ld: -r --gc-sections --entry bar
#readelf: -g --wide
-#xfail: cr16-*-* crx-*-* d30v-*-* dlx-*-* hppa64-*-* mep-*-* mn10200-*-*
-#xfail: pj*-*-* pru-*-* xgate-*-*
# generic linker targets don't support --gc-sections, nor do a bunch of others
-# cr16 and crx use non-standard scripts with memory regions, which don't play
-# well with unique group sections under ld -r.
+#xfail: d30v-*-* dlx-*-* hppa64-*-* mep-*-* mn10200-*-*
+#xfail: pj*-*-* pru-*-* xgate-*-*
COMDAT group section \[[ 0-9]+\] `.group' \[bar\] contains . sections:
\[Index\] Name
#source: group9.s
#ld: -r --gc-sections --entry foo
#readelf: -g --wide
-#xfail: cr16-*-* crx-*-* d30v-*-* dlx-*-* hppa64-*-* mep-*-* mn10200-*-*
-#xfail: pj*-*-* pru-*-* xgate-*-*
# generic linker targets don't support --gc-sections, nor do a bunch of others
-# cr16 and crx use non-standard scripts with memory regions, which don't play
-# well with unique group sections under ld -r.
+#xfail: d30v-*-* dlx-*-* hppa64-*-* mep-*-* mn10200-*-*
+#xfail: pj*-*-* pru-*-* xgate-*-*
COMDAT group section \[[ 0-9]+\] `.group' \[foo\] contains . sections:
\[Index\] Name
#source: group9.s
#ld: -r --gc-sections --entry bar
#readelf: -g --wide
-#xfail: cr16-*-* crx-*-* d30v-*-* dlx-*-* hppa64-*-* mep-*-* mn10200-*-*
-#xfail: pj*-*-* pru-*-* xgate-*-*
# generic linker targets don't support --gc-sections, nor do a bunch of others
-# cr16 and crx use non-standard scripts with memory regions, which don't play
-# well with unique group sections under ld -r.
+#xfail: d30v-*-* dlx-*-* hppa64-*-* mep-*-* mn10200-*-*
+#xfail: pj*-*-* pru-*-* xgate-*-*
COMDAT group section \[[ 0-9]+\] `.group' \[foo\] contains . sections:
\[Index\] Name
#source: init-fini-arrays.s
#ld: -r
#readelf: -S --wide
-#xfail: cr16-*-* crx-*-* msp430-*-*
-# msp430 puts the init_array and fini_array inside the .rodata section.
-# cr16 and crx use non-standard scripts with memory regions, which don't play
-# well with unique group sections under ld -r.
#...
\[[ 0-9]+\] \.init_array\.01000[ \t]+INIT_ARRAY[ \t0-9a-f]+WA?.*
#source: pr17550-2.s
#ld: -r
#readelf: -s --wide
-#xfail: alpha-*-* cr16-*-* crx-*-*
# Disabled on alpha because alpha has a different .set directive.
-# cr16 and crx use non-standard scripts with memory regions, which don't
-# play well with comdat group sections under ld -r.
+#xfail: alpha-*-*
#failif
#...
#source: pr17550-1.s
#ld: -r
#readelf: -s --wide
-#xfail: alpha-*-* cr16-*-* crx-*-*
# Disabled on alpha because alpha has a different .set directive.
-# cr16 and crx use non-standard scripts with memory regions, which don't
-# play well with comdat group sections under ld -r.
+#xfail: alpha-*-*
#failif
#...
#source: pr17550-4.s
#ld: -r
#readelf: -s --wide
-#xfail: alpha-*-* cr16-*-* crx-*-* d30v-*-* dlx-*-* pj*-*-* xgate-*-*
# Disabled on alpha because alpha has a different .set directive.
-# cr16 and crx use non-standard scripts with memory regions, which don't
-# play well with comdat group sections under ld -r. Generic linker
-# targets don't support comdat group sections.
+# Generic linker targets don't support comdat group sections.
+#xfail: alpha-*-* d30v-*-* dlx-*-* pj*-*-* xgate-*-*
#...
+[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +UND y
#ld: -r --gc-sections -u foo
#readelf: -S --wide
-#xfail: cr16-*-* crx-*-* d30v-*-* dlx-*-* hppa64-*-*
-#xfail: mep-*-* mn10200-*-* msp430-*-* pj*-*-* pru-*-* xgate-*-*
-# msp430 puts the init_array and fini_array inside the .rodata section.
# generic linker targets don't support --gc-sections, nor do a bunch of
# others.
-# cr16 and crx use non-standard scripts with memory regions, which don't
-# play well with unique group sections under ld -r.
+#xfail: d30v-*-* dlx-*-* hppa64-*-*
+#xfail: mep-*-* mn10200-*-* pj*-*-* pru-*-* xgate-*-*
#...
\[[ 0-9]+\] \.preinit_array\.01000[ \t]+PREINIT_ARRAY[ \t0-9a-f]+WA?.*