ELF ld -r scripts

"ld -r" generally should not combine object file sections with
different names.  For example, "ld -r" should not combine ".text",
".text.hot" and ".text.cold" into an output ".text" section.  An
exception needs to be made for linker created sections, for example,
branch trampoline sections that might be created even for ld -r.

"ld -r" also should not define symbols in linker scripts.  Any
definitions are likely to conflict with those defined at final link.

A MEMORY spec is also not needed for ld -r.

	* 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.
This commit is contained in:
Alan Modra 2018-10-12 12:06:40 +10:30
parent 8bca297856
commit 2bf2bf23da
75 changed files with 790 additions and 659 deletions

View File

@ -1,3 +1,53 @@
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> 2018-10-08 H.J. Lu <hongjiu.lu@intel.com>
PR ld/23428 PR ld/23428

View File

@ -990,6 +990,7 @@ eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \
$(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 \ eelf32btsmip_fbsd.c: $(srcdir)/emulparams/elf32btsmip_fbsd.sh \
${srcdir}/emulparams/elf32btsmip.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \ $(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}
@ -998,6 +999,8 @@ eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \
$(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 \ 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)/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}
@ -1042,10 +1045,9 @@ eelf32lr5900n32.c: $(srcdir)/emulparams/elf32lr5900n32.sh \
${GEN_DEPENDS} ${GEN_DEPENDS}
eelf32epiphany.c: $(srcdir)/emulparams/elf32epiphany.sh \ 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 \ eelf32epiphany_4x4.c: $(srcdir)/emulparams/elf32epiphany_4x4.sh \
$(srcdir)/emultempl/elf32.em \
$(ELF_DEPS) $(srcdir)/scripttempl/epiphany_4x4.sc ${GEN_DEPENDS} $(ELF_DEPS) $(srcdir)/scripttempl/epiphany_4x4.sc ${GEN_DEPENDS}
eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \ eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \
@ -1059,7 +1061,7 @@ eelf32frvfd.c: $(srcdir)/emulparams/elf32frvfd.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32ft32.c: $(srcdir)/emulparams/elf32ft32.sh \ 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 \ eelf32ip2k.c: $(srcdir)/emulparams/elf32ip2k.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@ -1139,6 +1141,7 @@ eelf32ltsmip.c: $(srcdir)/emulparams/elf32ltsmip.sh \
${GEN_DEPENDS} ${GEN_DEPENDS}
eelf32ltsmip_fbsd.c: $(srcdir)/emulparams/elf32ltsmip_fbsd.sh \ 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 \ $(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
$(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \ $(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
${GEN_DEPENDS} ${GEN_DEPENDS}
@ -1149,6 +1152,7 @@ eelf32ltsmipn32.c: $(srcdir)/emulparams/elf32ltsmipn32.sh \
$(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 \ eelf32ltsmipn32_fbsd.c: $(srcdir)/emulparams/elf32ltsmipn32_fbsd.sh \
${srcdir}/emulparams/elf32ltsmipn32.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf32btsmipn32.sh \ $(srcdir)/emulparams/elf32btsmipn32.sh \
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \ $(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}
@ -1263,15 +1267,15 @@ eelf32visium.c: $(srcdir)/emulparams/elf32visium.sh \
eelf32xc16x.c: $(srcdir)/emulparams/elf32xc16x.sh \ eelf32xc16x.c: $(srcdir)/emulparams/elf32xc16x.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \ $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(srcdir)/scripttempl/elf32xc16x.sc ${GEN_DEPENDS}
eelf32xc16xl.c: $(srcdir)/emulparams/elf32xc16xl.sh \ eelf32xc16xl.c: $(srcdir)/emulparams/elf32xc16xl.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \ $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(srcdir)/scripttempl/elf32xc16xl.sc ${GEN_DEPENDS}
eelf32xc16xs.c: $(srcdir)/emulparams/elf32xc16xs.sh \ eelf32xc16xs.c: $(srcdir)/emulparams/elf32xc16xs.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \ $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(srcdir)/scripttempl/elf32xc16xs.sc ${GEN_DEPENDS}
eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \ eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \ $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
@ -1449,7 +1453,7 @@ em9s12zelf.c: $(srcdir)/emulparams/m9s12zelf.sh \
$(srcdir)/scripttempl/elfm9s12z.sc ${GEN_DEPENDS} $(srcdir)/scripttempl/elfm9s12z.sc ${GEN_DEPENDS}
emcorepe.c: $(srcdir)/emulparams/mcorepe.sh \ 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 \ emn10200.c: $(srcdir)/emulparams/mn10200.sh \
$(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@ -1492,11 +1496,11 @@ ends32belf_linux.c: $(srcdir)/emulparams/nds32belf_linux.sh \
enios2elf.c: $(srcdir)/emulparams/nios2elf.sh \ enios2elf.c: $(srcdir)/emulparams/nios2elf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/nios2elf.em \ $(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 \ enios2linux.c: $(srcdir)/emulparams/nios2linux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/nios2elf.em \ $(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 \ ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \ $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \
@ -1758,6 +1762,7 @@ eelf64btsmip.c: $(srcdir)/emulparams/elf64btsmip.sh \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf64btsmip_fbsd.c: $(srcdir)/emulparams/elf64btsmip_fbsd.sh \ eelf64btsmip_fbsd.c: $(srcdir)/emulparams/elf64btsmip_fbsd.sh \
${srcdir}/emulparams/elf64btsmip.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf64bmip-defs.sh \ $(srcdir)/emulparams/elf64bmip-defs.sh \
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \ $(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}
@ -1795,7 +1800,8 @@ eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \
$(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 \ 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)/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}

View File

@ -2594,6 +2594,7 @@ eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \
$(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 \ eelf32btsmip_fbsd.c: $(srcdir)/emulparams/elf32btsmip_fbsd.sh \
${srcdir}/emulparams/elf32btsmip.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \ $(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}
@ -2602,6 +2603,8 @@ eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \
$(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 \ 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)/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}
@ -2646,10 +2649,9 @@ eelf32lr5900n32.c: $(srcdir)/emulparams/elf32lr5900n32.sh \
${GEN_DEPENDS} ${GEN_DEPENDS}
eelf32epiphany.c: $(srcdir)/emulparams/elf32epiphany.sh \ 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 \ eelf32epiphany_4x4.c: $(srcdir)/emulparams/elf32epiphany_4x4.sh \
$(srcdir)/emultempl/elf32.em \
$(ELF_DEPS) $(srcdir)/scripttempl/epiphany_4x4.sc ${GEN_DEPENDS} $(ELF_DEPS) $(srcdir)/scripttempl/epiphany_4x4.sc ${GEN_DEPENDS}
eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \ eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \
@ -2663,7 +2665,7 @@ eelf32frvfd.c: $(srcdir)/emulparams/elf32frvfd.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf32ft32.c: $(srcdir)/emulparams/elf32ft32.sh \ 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 \ eelf32ip2k.c: $(srcdir)/emulparams/elf32ip2k.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@ -2743,6 +2745,7 @@ eelf32ltsmip.c: $(srcdir)/emulparams/elf32ltsmip.sh \
${GEN_DEPENDS} ${GEN_DEPENDS}
eelf32ltsmip_fbsd.c: $(srcdir)/emulparams/elf32ltsmip_fbsd.sh \ 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 \ $(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
$(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \ $(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
${GEN_DEPENDS} ${GEN_DEPENDS}
@ -2753,6 +2756,7 @@ eelf32ltsmipn32.c: $(srcdir)/emulparams/elf32ltsmipn32.sh \
$(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 \ eelf32ltsmipn32_fbsd.c: $(srcdir)/emulparams/elf32ltsmipn32_fbsd.sh \
${srcdir}/emulparams/elf32ltsmipn32.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf32btsmipn32.sh \ $(srcdir)/emulparams/elf32btsmipn32.sh \
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \ $(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}
@ -2867,15 +2871,15 @@ eelf32visium.c: $(srcdir)/emulparams/elf32visium.sh \
eelf32xc16x.c: $(srcdir)/emulparams/elf32xc16x.sh \ eelf32xc16x.c: $(srcdir)/emulparams/elf32xc16x.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \ $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(srcdir)/scripttempl/elf32xc16x.sc ${GEN_DEPENDS}
eelf32xc16xl.c: $(srcdir)/emulparams/elf32xc16xl.sh \ eelf32xc16xl.c: $(srcdir)/emulparams/elf32xc16xl.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \ $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(srcdir)/scripttempl/elf32xc16xl.sc ${GEN_DEPENDS}
eelf32xc16xs.c: $(srcdir)/emulparams/elf32xc16xs.sh \ eelf32xc16xs.c: $(srcdir)/emulparams/elf32xc16xs.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \ $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(srcdir)/scripttempl/elf32xc16xs.sc ${GEN_DEPENDS}
eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \ eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \
$(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \ $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
@ -3053,7 +3057,7 @@ em9s12zelf.c: $(srcdir)/emulparams/m9s12zelf.sh \
$(srcdir)/scripttempl/elfm9s12z.sc ${GEN_DEPENDS} $(srcdir)/scripttempl/elfm9s12z.sc ${GEN_DEPENDS}
emcorepe.c: $(srcdir)/emulparams/mcorepe.sh \ 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 \ emn10200.c: $(srcdir)/emulparams/mn10200.sh \
$(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@ -3096,11 +3100,11 @@ ends32belf_linux.c: $(srcdir)/emulparams/nds32belf_linux.sh \
enios2elf.c: $(srcdir)/emulparams/nios2elf.sh \ enios2elf.c: $(srcdir)/emulparams/nios2elf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/nios2elf.em \ $(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 \ enios2linux.c: $(srcdir)/emulparams/nios2linux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/nios2elf.em \ $(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 \ ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \ $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \
@ -3362,6 +3366,7 @@ eelf64btsmip.c: $(srcdir)/emulparams/elf64btsmip.sh \
$(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
eelf64btsmip_fbsd.c: $(srcdir)/emulparams/elf64btsmip_fbsd.sh \ eelf64btsmip_fbsd.c: $(srcdir)/emulparams/elf64btsmip_fbsd.sh \
${srcdir}/emulparams/elf64btsmip.sh ${srcdir}/emulparams/elf_fbsd.sh \
$(srcdir)/emulparams/elf64bmip-defs.sh \ $(srcdir)/emulparams/elf64bmip-defs.sh \
$(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \ $(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}
@ -3399,7 +3404,8 @@ eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \
$(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 \ 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)/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}

View File

@ -34,4 +34,4 @@ OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};"
OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
# Ensure each PLT entry is aligned to a cache line. # 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)}} }"

View File

@ -34,4 +34,4 @@ OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};"
OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
# Ensure each PLT entry is aligned to a cache line. # 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)}} }"

View File

@ -34,7 +34,7 @@ OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};"
OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
# Ensure each PLT entry is aligned to a cache line. # 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 # Linux modifies the default library search path to first include
# a 64-bit specific directory. # a 64-bit specific directory.

View File

@ -34,7 +34,7 @@ OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};"
OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
# Ensure each PLT entry is aligned to a cache line. # 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 # Linux modifies the default library search path to first include
# a 32-bit specific directory. # a 32-bit specific directory.

View File

@ -1,3 +1,4 @@
if test -n "${RELOCATING}"; then
OTHER_SECTIONS=" OTHER_SECTIONS="
/* Start of symbols and sections required to support CMEM instructions /* Start of symbols and sections required to support CMEM instructions
on NPS targets. */ on NPS targets. */
@ -76,3 +77,4 @@ OTHER_SECTIONS="
/* End of nps specific sections and symbols. */ /* End of nps specific sections and symbols. */
${OTHER_SECTIONS}" ${OTHER_SECTIONS}"
fi

View File

@ -19,9 +19,9 @@ MAXPAGESIZE=0x80
DATA_ADDR="ALIGN(${MAXPAGESIZE})" DATA_ADDR="ALIGN(${MAXPAGESIZE})"
OTHER_BSS_SECTIONS=".toe ALIGN(128) : { *(.toe) } = 0" OTHER_BSS_SECTIONS=".toe ALIGN(128) : { *(.toe) } = 0"
OTHER_SECTIONS=".note.spu_name 0 : { KEEP(*(.note.spu_name)) } 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=" OTHER_READONLY_SECTIONS="
.fixup ${RELOCATING-0} : { .fixup ${RELOCATING-0} : {
PROVIDE (__fixup_start = .); ${RELOCATING+PROVIDE (__fixup_start = .);}
KEEP(*(.fixup)) KEEP(*(.fixup))
}" }"

View File

@ -15,8 +15,8 @@ case ${target} in
TEXT_START_ADDR=0x0 TEXT_START_ADDR=0x0
GOT=" GOT="
.got ${RELOCATING-0} : { .got ${RELOCATING-0} : {
*(.dsbt) ${RELOCATING+*(.dsbt)
*(.got.plt) *(.igot.plt) *(.got) *(.igot) *(.got.plt) *(.igot.plt) }*(.got)${RELOCATING+ *(.igot)}
}" }"
;; ;;
esac esac

View File

@ -58,9 +58,9 @@ OTHER_SDATA_SECTIONS="
TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};" TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};"
DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fdata = .${CREATE_SHLIB+)};" DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fdata = .${CREATE_SHLIB+)};"
OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fbss = .${CREATE_SHLIB+)};" OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fbss = .${CREATE_SHLIB+)};"
OTHER_SECTIONS=' OTHER_SECTIONS="
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } .gptab.sdata : {${RELOCATING+ *(.gptab.data)} *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } .gptab.sbss : {${RELOCATING+ *(.gptab.bss)} *(.gptab.sbss) }
.mdebug.abi32 0 : { KEEP(*(.mdebug.abi32)) } .mdebug.abi32 0 : { KEEP(*(.mdebug.abi32)) }
.mdebug.abiN32 0 : { KEEP(*(.mdebug.abiN32)) } .mdebug.abiN32 0 : { KEEP(*(.mdebug.abiN32)) }
.mdebug.abi64 0 : { KEEP(*(.mdebug.abi64)) } .mdebug.abi64 0 : { KEEP(*(.mdebug.abi64)) }
@ -69,7 +69,7 @@ OTHER_SECTIONS='
.mdebug.eabi64 0 : { KEEP(*(.mdebug.eabi64)) } .mdebug.eabi64 0 : { KEEP(*(.mdebug.eabi64)) }
.gcc_compiled_long32 0 : { KEEP(*(.gcc_compiled_long32)) } .gcc_compiled_long32 0 : { KEEP(*(.gcc_compiled_long32)) }
.gcc_compiled_long64 0 : { KEEP(*(.gcc_compiled_long64)) } .gcc_compiled_long64 0 : { KEEP(*(.gcc_compiled_long64)) }
' "
ARCH=mips ARCH=mips
MACHINE= MACHINE=
TEMPLATE_NAME=elf32 TEMPLATE_NAME=elf32

View File

@ -9,7 +9,7 @@ COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
# Magic sections. # Magic sections.
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_SECTIONS=' OTHER_SECTIONS="
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } .gptab.sdata : {${RELOCATING+ *(.gptab.data)} *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } .gptab.sbss : {${RELOCATING+ *(.gptab.bss)} *(.gptab.sbss) }
' "

View File

@ -12,10 +12,10 @@ EMBEDDED=yes
DYNAMIC_LINK=FALSE DYNAMIC_LINK=FALSE
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_SECTIONS=' OTHER_SECTIONS="
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } .gptab.sdata : {${RELOCATING+ *(.gptab.data)} *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } .gptab.sbss : {${RELOCATING+ *(.gptab.bss)} *(.gptab.sbss) }
' "
unset DATA_ADDR unset DATA_ADDR
SHLIB_TEXT_START_ADDR=0 SHLIB_TEXT_START_ADDR=0

View File

@ -7,6 +7,8 @@ MAXPAGESIZE=256
ENTRY=_start ENTRY=_start
EMBEDDED=yes EMBEDDED=yes
TEMPLATE_NAME=elf32 TEMPLATE_NAME=elf32
if test -n "${RELOCATING}"; then
DATA_START_SYMBOLS='__data_start = . ;' DATA_START_SYMBOLS='__data_start = . ;'
OTHER_GOT_SYMBOLS=' OTHER_GOT_SYMBOLS='
. = ALIGN(4); . = ALIGN(4);
@ -53,3 +55,4 @@ OTHER_BSS_SECTIONS='
__assert_near_size = ASSERT (. <= 0x1000000, "near section overflow"); __assert_near_size = ASSERT (. <= 0x1000000, "near section overflow");
.farbss : { PROVIDE (__farbss_start = .); *(.farbss) *(.farbss.*) PROVIDE (__farbss_end = .); } .farbss : { PROVIDE (__farbss_start = .); *(.farbss) *(.farbss.*) PROVIDE (__farbss_end = .); }
' '
fi

View File

@ -12,7 +12,7 @@ ENTRY=__start
NOP=0xa0fffffe NOP=0xa0fffffe
EXTRA_EM_FILE=metagelf EXTRA_EM_FILE=metagelf
USER_LABEL_PREFIX=_ USER_LABEL_PREFIX=_
OTHER_SECTIONS=" test -n "${RELOCATING}" && OTHER_SECTIONS="
.core_text 0x80000000 : .core_text 0x80000000 :
{ {
*(.core_text) *(.core_text)

View File

@ -8,9 +8,9 @@ LITTLE_OUTPUT_FORMAT="elf64-tradlittlemips"
# Magic sections. # Magic sections.
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)' OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_SECTIONS=' OTHER_SECTIONS="
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } .gptab.sdata : {${RELOCATING+ *(.gptab.data)} *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } .gptab.sbss : {${RELOCATING+ *(.gptab.bss)} *(.gptab.sbss) }
' "
TEXT_START_ADDR="0x120000000" TEXT_START_ADDR="0x120000000"

View File

@ -16,6 +16,6 @@ ENTRY=__start
SYMPREFIX=_ SYMPREFIX=_
GOT=".got ${RELOCATING-0} : { GOT=".got ${RELOCATING-0} : {
PROVIDE(__GLOBAL_OFFSET_TABLE_ = .); ${RELOCATING+PROVIDE(__GLOBAL_OFFSET_TABLE_ = .);
*(.got.plt) *(.got) }" *(.got.plt) }*(.got) }"
. ${srcdir}/emulparams/vxworks.sh . ${srcdir}/emulparams/vxworks.sh

View File

@ -3,7 +3,7 @@
. ${srcdir}/emulparams/shlelf_linux.sh . ${srcdir}/emulparams/shlelf_linux.sh
OUTPUT_FORMAT="elf32-sh-fdpic" 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=" OTHER_GOT_RELOC_SECTIONS="
.rela.got.funcdesc ${RELOCATING-0} : { *(.rela.got.funcdesc) } .rela.got.funcdesc ${RELOCATING-0} : { *(.rela.got.funcdesc) }
" "

View File

@ -24,7 +24,7 @@ cat <<EOF
/* DWARF 2 */ /* DWARF 2 */
.debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) } .debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) }
.debug_abbrev 0 : { *(.debug_abbrev) } .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_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) } .debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) } .debug_loc 0 : { *(.debug_loc) }

View File

@ -32,16 +32,16 @@ SECTIONS
{ {
${RELOCATING+. = ${TEXT_START_ADDR};} ${RELOCATING+. = ${TEXT_START_ADDR};}
.text : { .text : {
${RELOCATING+ _ftext = . }; ${RELOCATING+ _ftext = .;}
${RELOCATING+ __istart = . }; ${RELOCATING+ __istart = .;}
${RELOCATING+ *(.init) } ${RELOCATING+ *(.init)}
${RELOCATING+ LONG (0x6bfa8001)} ${RELOCATING+ LONG (0x6bfa8001)}
${RELOCATING+ eprol = .}; ${RELOCATING+ eprol = .;}
*(.text) *(.text)
${RELOCATING+ __fstart = . }; ${RELOCATING+ __fstart = .;}
${RELOCATING+ *(.fini)} ${RELOCATING+ *(.fini)}
${RELOCATING+ LONG (0x6bfa8001)} ${RELOCATING+ LONG (0x6bfa8001)}
${RELOCATING+ _etext = .}; ${RELOCATING+ _etext = .;}
} }
.rdata : { .rdata : {
*(.rdata) *(.rdata)
@ -76,11 +76,11 @@ SECTIONS
${RELOCATING+ _FBSS = .;} ${RELOCATING+ _FBSS = .;}
.sbss : { .sbss : {
*(.sbss) *(.sbss)
*(.scommon) ${RELOCATING+*(.scommon)}
} }
.bss : { .bss : {
*(.bss) *(.bss)
*(COMMON) ${RELOCATING+*(COMMON)}
} }
${RELOCATING+ _end = .;} ${RELOCATING+ _end = .;}
} }

View File

@ -33,13 +33,13 @@ SECTIONS
} }
/* RO, executable code. */ /* RO, executable code. */
\$CODE\$ ALIGN (${PAGESIZE}) : { \$CODE\$ ALIGN (${PAGESIZE}) : {
*(\$CODE\$ *\$CODE*) *(\$CODE\$${RELOCATING+ *\$CODE*})
} }
/* RO initialized data. */ /* RO initialized data. */
\$LITERAL\$ ALIGN (${PAGESIZE}) : { \$LITERAL\$ ALIGN (${PAGESIZE}) : {
*(\$LINK\$) ${RELOCATING+*(\$LINK\$)}
*(\$LITERAL\$) *(\$LITERAL\$)
*(\$READONLY\$) ${RELOCATING+*(\$READONLY\$)
*(\$READONLY_ADDR\$) *(\$READONLY_ADDR\$)
*(eh_frame) *(eh_frame)
*(jcr) *(jcr)
@ -51,11 +51,11 @@ SECTIONS
*(LIB\$INITIALIZDZ) /* Start marker. */ *(LIB\$INITIALIZDZ) /* Start marker. */
*(LIB\$INITIALIZD_) /* Hi priority. */ *(LIB\$INITIALIZD_) /* Hi priority. */
*(LIB\$INITIALIZE) /* User. */ *(LIB\$INITIALIZE) /* User. */
*(LIB\$INITIALIZE$) /* End marker. */ *(LIB\$INITIALIZE$) /* End marker. */}
} }
\$DWARF\$ ALIGN (${PAGESIZE}) : { \$DWARF\$ ALIGN (${PAGESIZE}) : {
\$dwarf2.debug_pubtypes = .; ${RELOCATING+\$dwarf2.debug_pubtypes = .;
*(debug_pubtypes) *(debug_pubtypes)
\$dwarf2.debug_ranges = .; \$dwarf2.debug_ranges = .;
*(debug_ranges) *(debug_ranges)
@ -80,7 +80,7 @@ SECTIONS
*(debug_pubnames) *(debug_pubnames)
\$dwarf2.debug_str = .; \$dwarf2.debug_str = .;
*(debug_str) *(debug_str)
\$dwarf2.debug_zzzzzz = .; \$dwarf2.debug_zzzzzz = .;}
} }
\$DST\$ 0 : { \$DST\$ 0 : {

View File

@ -141,16 +141,16 @@ if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
fi fi
if test -z "$PLT"; then if test -z "$PLT"; then
IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }" 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}" ${IREL_IN_PLT-$IPLT}"
fi fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT= test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=
if test -z "$GOT"; then if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; 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 else
GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }" GOT=".got ${RELOCATING-0} : { *(.got)${RELOCATING+ *(.igot)} }"
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }" GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt)${RELOCATING+ *(.igot.plt)} }"
fi fi
fi fi
REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }" REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }"
@ -176,9 +176,9 @@ if test -z "${NO_SMALL_DATA}"; then
{ {
${RELOCATING+${SBSS_START_SYMBOLS}} ${RELOCATING+${SBSS_START_SYMBOLS}}
${CREATE_SHLIB+*(.${SBSS_NAME}2 .${SBSS_NAME}2.* .gnu.linkonce.sb2.*)} ${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.*}) *(.${SBSS_NAME}${RELOCATING+ .${SBSS_NAME}.* .gnu.linkonce.sb.*})
*(.scommon) ${RELOCATING+*(.scommon)}
${RELOCATING+${SBSS_END_SYMBOLS}} ${RELOCATING+${SBSS_END_SYMBOLS}}
}" }"
SBSS2=".${SBSS_NAME}2 ${RELOCATING-0} : { *(.${SBSS_NAME}2${RELOCATING+ .${SBSS_NAME}2.* .gnu.linkonce.sb2.*}) }" SBSS2=".${SBSS_NAME}2 ${RELOCATING-0} : { *(.${SBSS_NAME}2${RELOCATING+ .${SBSS_NAME}2.* .gnu.linkonce.sb2.*}) }"
@ -541,12 +541,10 @@ cat <<EOF
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) ${RELOCATING+*(.eh_frame_entry .eh_frame_entry.*)} } .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.*)} } .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 ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
.gcc_except_table.*) }
.gnu_extab ${RELOCATING-0} : ONLY_IF_RO { *(.gnu_extab*) } .gnu_extab ${RELOCATING-0} : ONLY_IF_RO { *(.gnu_extab*) }
/* These sections are generated by the Sun/Oracle C++ compiler. */ /* These sections are generated by the Sun/Oracle C++ compiler. */
.exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges${RELOCATING+*}) }
.exception_ranges*) }
${TEXT_PLT+${PLT_NEXT_DATA+${PLT}}} ${TEXT_PLT+${PLT_NEXT_DATA+${PLT}}}
/* Adjust the address for the data segment. We want to adjust up to /* Adjust the address for the data segment. We want to adjust up to
@ -558,12 +556,12 @@ cat <<EOF
/* Exception handling */ /* 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) } .gnu_extab ${RELOCATING-0} : ONLY_IF_RW { *(.gnu_extab) }
.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.*}) }
.exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges${RELOCATING+*}) }
/* Thread Local Storage sections */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { PROVIDE_HIDDEN(.tdata = .); *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tdata ${RELOCATING-0} : { ${RELOCATING+PROVIDE_HIDDEN(.tdata = .); }*(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
.tbss ${RELOCATING-0} : { PROVIDE_HIDDEN(.tbss = .); *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} } .tbss ${RELOCATING-0} : { ${RELOCATING+PROVIDE_HIDDEN(.tbss = .); }*(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
.preinit_array ${RELOCATING-0} : .preinit_array ${RELOCATING-0} :
{ {
@ -621,15 +619,15 @@ cat <<EOF
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.${BSS_NAME} ${RELOCATING-0} : .${BSS_NAME} ${RELOCATING-0} :
{ {
*(.dyn${BSS_NAME}) ${RELOCATING+*(.dyn${BSS_NAME})}
*(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*}) *(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. .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. */ pad the .data section. */
${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
} }
${OTHER_BSS_SECTIONS} ${OTHER_BSS_SECTIONS}
${LARGE_BSS_AFTER_BSS+${LARGE_BSS}} ${LARGE_BSS_AFTER_BSS+${LARGE_BSS}}

View File

@ -42,9 +42,9 @@ if test -z "${NO_SMALL_DATA}"; then
{ {
${RELOCATING+PROVIDE (__sbss_start = .);} ${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);} ${RELOCATING+PROVIDE (___sbss_start = .);}
*(.dynsbss) ${RELOCATING+*(.dynsbss)}
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*}) *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
*(.scommon) ${RELOCATING+*(.scommon)}
${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);} ${RELOCATING+PROVIDE (___sbss_end = .);}
}" }"
@ -154,17 +154,16 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}") "${LITTLE_OUTPUT_FORMAT}")
OUTPUT_ARCH(${OUTPUT_ARCH}) OUTPUT_ARCH(${OUTPUT_ARCH})
${RELOCATING+ENTRY(${ENTRY})} EOF
${RELOCATING+${LIB_SEARCH_DIRS}} test -n "${RELOCATING}" && cat <<EOF
${RELOCATING+/* Do we need any of these for elf? ENTRY(${ENTRY})
__DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${LIB_SEARCH_DIRS}
${RELOCATING+${INPUT_FILES}} /* Do we need any of these for elf?
${RELOCATING- /* For some reason, the Solaris linker makes bad executables __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */
if gld -r is used and the intermediate file has sections starting ${EXECUTABLE_SYMBOLS}
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld ${INPUT_FILES}
bug. But for now assigning the zero vmas works. */}
/* ARM's proprietary toolchain generate these symbols to match the start /* ARM's proprietary toolchain generate these symbols to match the start
and end of particular sections of the image. SymbianOS uses these and end of particular sections of the image. SymbianOS uses these
@ -187,6 +186,9 @@ VERSION
}; };
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
/* Read-only sections, merged into text segment: */ /* Read-only sections, merged into text segment: */
@ -254,7 +256,7 @@ cat <<EOF
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } .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 /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */ the same address within the page on the next page up. */
@ -264,7 +266,7 @@ cat <<EOF
/* Exception handling */ /* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } .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 */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
@ -303,13 +305,13 @@ cat <<EOF
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} : .bss ${RELOCATING-0} :
{ {
*(.dynbss) ${RELOCATING+*(.dynbss)}
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */ .bss section disappears because there are no input sections. */
${RELOCATING+. = ALIGN(${ALIGNMENT});} . = ALIGN(${ALIGNMENT});}
} }
${RELOCATING+${OTHER_BSS_END_SYMBOLS}} ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+. = ALIGN(${ALIGNMENT});}

View File

@ -24,7 +24,9 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
EOF
test -n "${RELOCATING}" && cat <<EOF
__TEXT_REGION_LENGTH__ = DEFINED(__TEXT_REGION_LENGTH__) ? __TEXT_REGION_LENGTH__ : $TEXT_LENGTH; __TEXT_REGION_LENGTH__ = DEFINED(__TEXT_REGION_LENGTH__) ? __TEXT_REGION_LENGTH__ : $TEXT_LENGTH;
__DATA_REGION_LENGTH__ = DEFINED(__DATA_REGION_LENGTH__) ? __DATA_REGION_LENGTH__ : $DATA_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;} ${EEPROM_LENGTH+__EEPROM_REGION_LENGTH__ = DEFINED(__EEPROM_REGION_LENGTH__) ? __EEPROM_REGION_LENGTH__ : $EEPROM_LENGTH;}
@ -43,7 +45,9 @@ ${EEPROM_LENGTH+ eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = __EEPROM_REGION_LE
signature (rw!x) : ORIGIN = 0x840000, LENGTH = __SIGNATURE_REGION_LENGTH__ signature (rw!x) : ORIGIN = 0x840000, LENGTH = __SIGNATURE_REGION_LENGTH__
${USER_SIGNATURE_LENGTH+ user_signatures (rw!x) : ORIGIN = 0x850000, LENGTH = __USER_SIGNATURE_REGION_LENGTH__} ${USER_SIGNATURE_LENGTH+ user_signatures (rw!x) : ORIGIN = 0x850000, LENGTH = __USER_SIGNATURE_REGION_LENGTH__}
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
/* Read-only sections, merged into text segment: */ /* Read-only sections, merged into text segment: */
@ -109,32 +113,32 @@ SECTIONS
/* Internal text space or external memory. */ /* Internal text space or external memory. */
.text ${RELOCATING-0} : .text ${RELOCATING-0} :
{ {
*(.vectors) ${RELOCATING+*(.vectors)
KEEP(*(.vectors)) KEEP(*(.vectors))
/* For data that needs to reside in the lower 64k of progmem. */ /* 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 /* PR 13812: Placing the trampolines here gives a better chance
that they will be in range of the code that uses them. */ that they will be in range of the code that uses them. */
${RELOCATING+. = ALIGN(2);} . = ALIGN(2);
${CONSTRUCTING+ __trampolines_start = . ; } __trampolines_start = . ;
/* The jump trampolines for the 16-bit limited relocs will reside here. */ /* The jump trampolines for the 16-bit limited relocs will reside here. */
*(.trampolines) *(.trampolines)
${RELOCATING+ *(.trampolines*)} *(.trampolines*)
${CONSTRUCTING+ __trampolines_end = . ; } __trampolines_end = . ;
/* avr-libc expects these data to reside in lower 64K. */ /* avr-libc expects these data to reside in lower 64K. */
${RELOCATING+ *libprintf_flt.a:*(.progmem.data)} *libprintf_flt.a:*(.progmem.data)
${RELOCATING+ *libc.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. */ /* For code that needs to reside in the lower 128k progmem. */
*(.lowtext) *(.lowtext)
${RELOCATING+ *(.lowtext*)} *(.lowtext*)}
${CONSTRUCTING+ __ctors_start = . ; } ${CONSTRUCTING+ __ctors_start = . ; }
${CONSTRUCTING+ *(.ctors) } ${CONSTRUCTING+ *(.ctors) }
@ -142,10 +146,10 @@ SECTIONS
${CONSTRUCTING+ __dtors_start = . ; } ${CONSTRUCTING+ __dtors_start = . ; }
${CONSTRUCTING+ *(.dtors) } ${CONSTRUCTING+ *(.dtors) }
${CONSTRUCTING+ __dtors_end = . ; } ${CONSTRUCTING+ __dtors_end = . ; }
KEEP(SORT(*)(.ctors)) ${RELOCATING+KEEP(SORT(*)(.ctors))
KEEP(SORT(*)(.dtors)) 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. */ below or above the 16 bits boundary. */
*(.init0) /* Start here after reset. */ *(.init0) /* Start here after reset. */
KEEP (*(.init0)) KEEP (*(.init0))
@ -166,11 +170,11 @@ SECTIONS
*(.init8) *(.init8)
KEEP (*(.init8)) KEEP (*(.init8))
*(.init9) /* Call main(). */ *(.init9) /* Call main(). */
KEEP (*(.init9)) KEEP (*(.init9))}
*(.text) *(.text)
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);
${RELOCATING+ *(.text.*)} *(.text.*)
${RELOCATING+. = ALIGN(2);} . = ALIGN(2);
*(.fini9) /* _exit() starts here. */ *(.fini9) /* _exit() starts here. */
KEEP (*(.fini9)) KEEP (*(.fini9))
*(.fini8) *(.fini8)
@ -194,18 +198,18 @@ SECTIONS
/* For code that needs not to reside in the lower progmem. */ /* For code that needs not to reside in the lower progmem. */
*(.hightext) *(.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. */ JMP / CALL instructions within these sections. */
*(.jumptables) *(.jumptables)
${RELOCATING+ *(.jumptables*)} *(.jumptables*)
${RELOCATING+ _etext = . ; } _etext = . ;}
} ${RELOCATING+ > text} } ${RELOCATING+ > text}
EOF EOF
@ -218,8 +222,8 @@ if test -n "$RODATA_PM_OFFSET"; then
.rodata ${RELOCATING+ ADDR(.text) + SIZEOF (.text) + __RODATA_PM_OFFSET__ } ${RELOCATING-0} : .rodata ${RELOCATING+ ADDR(.text) + SIZEOF (.text) + __RODATA_PM_OFFSET__ } ${RELOCATING-0} :
{ {
*(.rodata) *(.rodata)
${RELOCATING+ *(.rodata*)} ${RELOCATING+ *(.rodata*)
*(.gnu.linkonce.r*) *(.gnu.linkonce.r*)}
} ${RELOCATING+AT> text} } ${RELOCATING+AT> text}
EOF EOF
fi fi
@ -229,18 +233,18 @@ cat <<EOF
{ {
${RELOCATING+ PROVIDE (__data_start = .) ; } ${RELOCATING+ PROVIDE (__data_start = .) ; }
*(.data) *(.data)
${RELOCATING+ *(.data*)} ${RELOCATING+ *(.data*)
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)}
EOF EOF
# Classical devices that don't show flash memory in the SRAM address space # 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* # need .rodata to be part of .data because the compiler will use LD*
# instructions and LD* cannot access flash. # 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 cat <<EOF
*(.rodata) /* We need to include .rodata here if gcc is used */ *(.rodata) /* We need to include .rodata here if gcc is used */
${RELOCATING+ *(.rodata*)} /* with -fdata-sections. */ *(.rodata*) /* with -fdata-sections. */
*(.gnu.linkonce.r*) *(.gnu.linkonce.r*)
EOF EOF
fi fi
@ -256,7 +260,7 @@ cat <<EOF
${RELOCATING+ PROVIDE (__bss_start = .) ; } ${RELOCATING+ PROVIDE (__bss_start = .) ; }
*(.bss) *(.bss)
${RELOCATING+ *(.bss*)} ${RELOCATING+ *(.bss*)}
*(COMMON) ${RELOCATING+ *(COMMON)}
${RELOCATING+ PROVIDE (__bss_end = .) ; } ${RELOCATING+ PROVIDE (__bss_end = .) ; }
} ${RELOCATING+ > data} } ${RELOCATING+ > data}
@ -292,9 +296,9 @@ cat <<EOF
.fuse ${RELOCATING-0}: .fuse ${RELOCATING-0}:
{ {
KEEP(*(.fuse)) KEEP(*(.fuse))
KEEP(*(.lfuse)) ${RELOCATING+KEEP(*(.lfuse))
KEEP(*(.hfuse)) KEEP(*(.hfuse))
KEEP(*(.efuse)) KEEP(*(.efuse))}
} ${RELOCATING+ > fuse} } ${RELOCATING+ > fuse}
EOF EOF
fi fi

View File

@ -21,7 +21,7 @@ SECTIONS
${RELOCATING+. = ${TEXT_START_ADDR};} ${RELOCATING+. = ${TEXT_START_ADDR};}
.text : .text :
{ {
CREATE_OBJECT_SYMBOLS ${RELOCATING+CREATE_OBJECT_SYMBOLS}
*(.text) *(.text)
${RELOCATING+etext = ${DATA_ALIGNMENT};} ${RELOCATING+etext = ${DATA_ALIGNMENT};}
} }
@ -35,8 +35,8 @@ SECTIONS
.bss : .bss :
{ {
*(.bss) *(.bss)
*(COMMON) ${RELOCATING+*(COMMON)}
${RELOCATING+end = . }; ${RELOCATING+end = .;}
} }
} }
EOF EOF

View File

@ -144,16 +144,16 @@ if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
fi fi
if test -z "$PLT"; then if test -z "$PLT"; then
IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }" 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}" ${IREL_IN_PLT-$IPLT}"
fi fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT= test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=
if test -z "$GOT"; then if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; 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 else
GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }" GOT=".got ${RELOCATING-0} : { *(.got)${RELOCATING+ *(.igot)} }"
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }" GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt)${RELOCATING+ *(.igot.plt)} }"
fi fi
fi fi
REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }" REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }"
@ -179,9 +179,9 @@ if test -z "${NO_SMALL_DATA}"; then
{ {
${RELOCATING+${SBSS_START_SYMBOLS}} ${RELOCATING+${SBSS_START_SYMBOLS}}
${CREATE_SHLIB+*(.${SBSS_NAME}2 .${SBSS_NAME}2.* .gnu.linkonce.sb2.*)} ${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.*}) *(.${SBSS_NAME}${RELOCATING+ .${SBSS_NAME}.* .gnu.linkonce.sb.*})
*(.scommon) ${RELOCATING+*(.scommon)}
${RELOCATING+${SBSS_END_SYMBOLS}} ${RELOCATING+${SBSS_END_SYMBOLS}}
}" }"
SBSS2=".${SBSS_NAME}2 ${RELOCATING-0} : { *(.${SBSS_NAME}2${RELOCATING+ .${SBSS_NAME}2.* .gnu.linkonce.sb2.*}) }" SBSS2=".${SBSS_NAME}2 ${RELOCATING-0} : { *(.${SBSS_NAME}2${RELOCATING+ .${SBSS_NAME}2.* .gnu.linkonce.sb2.*}) }"
@ -231,9 +231,9 @@ test "${LARGE_SECTIONS}" = "yes" && REL_LARGE="
test "${LARGE_SECTIONS}" = "yes" && LARGE_BSS=" test "${LARGE_SECTIONS}" = "yes" && LARGE_BSS="
.lbss ${RELOCATING-0} : .lbss ${RELOCATING-0} :
{ {
*(.dynlbss) ${RELOCATING+*(.dynlbss)}
*(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*}) *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
*(LARGE_COMMON) ${RELOCATING+*(LARGE_COMMON)}
}" }"
test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
.lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : .lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
@ -245,12 +245,6 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
*(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*}) *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*})
${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} ${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 if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))" 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.*)))" SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
@ -262,19 +256,25 @@ else
CTORS_IN_INIT_ARRAY= CTORS_IN_INIT_ARRAY=
DTORS_IN_FINI_ARRAY= DTORS_IN_FINI_ARRAY=
fi 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} ${SORT_INIT_ARRAY}
KEEP (*(.init_array ${CTORS_IN_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} ${SORT_FINI_ARRAY}
KEEP (*(.fini_array ${DTORS_IN_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} : CTOR=".ctors ${CONSTRUCTING-0} :
{ {
@ -327,7 +327,7 @@ SHLIB_TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${SHLIB_TEXT_START_ADDR:-
if test -z "$TINY_READONLY_SECTION"; then if test -z "$TINY_READONLY_SECTION"; then
case "$LD_FLAG" in case "$LD_FLAG" in
*textonly*) *textonly*)
SEPARATE_TEXT=yes SEPARATE_TEXT=" "
TEXT_SEGMENT_ALIGN=". = ALIGN(${MAXPAGESIZE});" TEXT_SEGMENT_ALIGN=". = ALIGN(${MAXPAGESIZE});"
;; ;;
esac esac
@ -368,7 +368,7 @@ ${RELOCATING- /* For some reason, the Solaris linker makes bad executables
SECTIONS 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-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR}${SIZEOF_HEADERS_CODE};}} ${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};}} ${CREATE_PIE+${RELOCATING+PROVIDE (__executable_start = ${SHLIB_TEXT_START_ADDR}); . = ${SHLIB_TEXT_START_ADDR}${SIZEOF_HEADERS_CODE};}}
@ -546,11 +546,11 @@ SEGMENT_START(\"rodata-segment\", ${SHLIB_RODATA_ADDR}) + SIZEOF_HEADERS"
SHLIB_RODATA_ADDR="SEGMENT_START(\"rodata-segment\", ${SHLIB_RODATA_ADDR})" SHLIB_RODATA_ADDR="SEGMENT_START(\"rodata-segment\", ${SHLIB_RODATA_ADDR})"
fi fi
cat <<EOF 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. */ the same address within the page on the next page up. */
${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${RODATA_ADDR};}}} ${CREATE_SHLIB-${CREATE_PIE-. = ${RODATA_ADDR};}}
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_RODATA_ADDR};}} ${CREATE_SHLIB+. = ${SHLIB_RODATA_ADDR};}
${CREATE_PIE+${RELOCATING+. = ${SHLIB_RODATA_ADDR};}} ${CREATE_PIE+. = ${SHLIB_RODATA_ADDR};}}
EOF EOF
if test -n "${SEPARATE_CODE}"; then if test -n "${SEPARATE_CODE}"; then
emit_early_ro emit_early_ro
@ -564,27 +564,25 @@ cat <<EOF
${CREATE_SHLIB-${SDATA2}} ${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}} ${CREATE_SHLIB-${SBSS2}}
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) ${RELOCATING+*(.eh_frame_entry .eh_frame_entry.*)} } .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.*)} } .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 ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
.gcc_except_table.*) }
.gnu_extab ${RELOCATING-0} : ONLY_IF_RO { *(.gnu_extab*) } .gnu_extab ${RELOCATING-0} : ONLY_IF_RO { *(.gnu_extab*) }
/* These sections are generated by the Sun/Oracle C++ compiler. */ /* These sections are generated by the Sun/Oracle C++ compiler. */
.exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges${RELOCATING+*}) }
.exception_ranges*) }
${TEXT_PLT+${PLT_NEXT_DATA+${PLT} ${OTHER_PLT_SECTIONS}}} ${TEXT_PLT+${PLT_NEXT_DATA+${PLT} ${OTHER_PLT_SECTIONS}}}
/* Adjust the address for the data segment. We want to adjust up to ${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. */ the same address within the page on the next page up. */}
${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}} ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} ${CREATE_SHLIB+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}
${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} ${CREATE_PIE+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}
/* Exception handling */ /* 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) } .gnu_extab ${RELOCATING-0} : ONLY_IF_RW { *(.gnu_extab) }
.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.*}) }
.exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges${RELOCATING+*}) }
/* Thread Local Storage sections */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : .tdata ${RELOCATING-0} :
@ -647,13 +645,13 @@ cat <<EOF
{ {
${RELOCATING+*(.dynbss)} ${RELOCATING+*(.dynbss)}
*(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*}) *(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. .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. */ pad the .data section. */
${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
} }
${OTHER_BSS_SECTIONS} ${OTHER_BSS_SECTIONS}
${LARGE_BSS_AFTER_BSS+${LARGE_BSS}} ${LARGE_BSS_AFTER_BSS+${LARGE_BSS}}
@ -666,8 +664,8 @@ SHLIB_LARGE_DATA_ADDR=". = SEGMENT_START(\"ldata-segment\", ${SHLIB_LARGE_DATA_A
cat <<EOF cat <<EOF
${RELOCATING+${CREATE_SHLIB-${CREATE_PIE-${LARGE_DATA_ADDR}}}} ${RELOCATING+${CREATE_SHLIB-${CREATE_PIE-${LARGE_DATA_ADDR}}}}
${RELOCATING+${CREATE_SHLIB+${SHLIB_LARGE_DATA_ADDR}}} ${CREATE_SHLIB+${SHLIB_LARGE_DATA_ADDR}}
${RELOCATING+${CREATE_PIE+${SHLIB_LARGE_DATA_ADDR}}} ${CREATE_PIE+${SHLIB_LARGE_DATA_ADDR}}
${LARGE_SECTIONS} ${LARGE_SECTIONS}
${LARGE_BSS_AFTER_BSS-${LARGE_BSS}} ${LARGE_BSS_AFTER_BSS-${LARGE_BSS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+. = ALIGN(${ALIGNMENT});}
@ -692,7 +690,7 @@ cat <<EOF
.comment 0 : { *(.comment) } .comment 0 : { *(.comment) }
.gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) } .gnu.build.attributes : { *(.gnu.build.attributes${RELOCATING+ .gnu.build.attributes.*}) }
EOF EOF

View File

@ -6,6 +6,10 @@
# are permitted in any medium without royalty provided the copyright # are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. # 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 # The next line should be uncommented if it is desired to link
# without libstart.o and directly enter main. # without libstart.o and directly enter main.
@ -23,7 +27,10 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
${RELOCATING+ENTRY(${ENTRY})} EOF
test -n "${RELOCATING}" && cat <<EOF
ENTRY(${ENTRY})
/* Define memory regions. */ /* Define memory regions. */
MEMORY MEMORY
@ -32,6 +39,9 @@ MEMORY
ram : ORIGIN = 4M, LENGTH = 10M ram : ORIGIN = 4M, LENGTH = 10M
} }
EOF
cat <<EOF
/* Many sections come in three flavours. There is the 'real' section, /* Many sections come in three flavours. There is the 'real' section,
like ".data". Then there are the per-procedure or per-variable like ".data". Then there are the per-procedure or per-variable
sections, generated by -ffunction-sections and -fdata-sections in GCC, sections, generated by -ffunction-sections and -fdata-sections in GCC,
@ -54,33 +64,33 @@ SECTIONS
__INIT_START = .; __INIT_START = .;
KEEP (*(.init)) KEEP (*(.init))
__INIT_END = .; __INIT_END = .;
} > rom }${RELOCATING+ > rom}
.fini : .fini :
{ {
__FINI_START = .; __FINI_START = .;
KEEP (*(.fini)) KEEP (*(.fini))
__FINI_END = .; __FINI_END = .;
} > rom }${RELOCATING+ > rom}
.jcr : .jcr :
{ {
KEEP (*(.jcr)) KEEP (*(.jcr))
} > rom }${RELOCATING+ > rom}
.text : .text :
{ {
__TEXT_START = .; __TEXT_START = .;
*(.text) *(.text.*) *(.gnu.linkonce.t.*) *(.text) *(.text.*) *(.gnu.linkonce.t.*)
__TEXT_END = .; __TEXT_END = .;
} > rom }${RELOCATING+ > rom}
.rdata : .rdata :
{ {
__RDATA_START = .; __RDATA_START = .;
*(.rdata_4) *(.rdata_2) *(.rdata_1) *(.rdata.*) *(.gnu.linkonce.r.*) *(.rodata*) *(.rdata_4) *(.rdata_2) *(.rdata_1) *(.rdata.*) *(.gnu.linkonce.r.*) *(.rodata*)
__RDATA_END = .; __RDATA_END = .;
} > rom }${RELOCATING+ > rom}
.ctor ALIGN(4) : .ctor ALIGN(4) :
{ {
@ -106,7 +116,7 @@ SECTIONS
KEEP (*(SORT(.ctors.*))) KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors)) KEEP (*(.ctors))
__CTOR_END = .; __CTOR_END = .;
} > rom }${RELOCATING+ > rom}
.dtor ALIGN(4) : .dtor ALIGN(4) :
{ {
@ -116,21 +126,21 @@ SECTIONS
KEEP (*(SORT(.dtors.*))) KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors)) KEEP (*(.dtors))
__DTOR_END = .; __DTOR_END = .;
} > rom }${RELOCATING+ > rom}
.data : .data :
{ {
__DATA_START = .; __DATA_START = .;
*(.data_4) *(.data_2) *(.data_1) *(.data) *(.data.*) *(.gnu.linkonce.d.*) *(.data_4) *(.data_2) *(.data_1) *(.data) *(.data.*) *(.gnu.linkonce.d.*)
__DATA_END = .; __DATA_END = .;
} > ram AT > rom }${RELOCATING+ > ram AT > rom}
.bss (NOLOAD) : .bss (NOLOAD) :
{ {
__BSS_START = .; __BSS_START = .;
*(.bss_4) *(.bss_2) *(.bss_1) *(.bss) *(COMMON) *(.bss.*) *(.gnu.linkonce.b.*) *(.bss_4) *(.bss_2) *(.bss_1) *(.bss) *(COMMON) *(.bss.*) *(.gnu.linkonce.b.*)
__BSS_END = .; __BSS_END = .;
} > ram }${RELOCATING+ > ram}
/* You may change the sizes of the following sections to fit the actual /* You may change the sizes of the following sections to fit the actual
size your program requires. size your program requires.
@ -143,21 +153,21 @@ SECTIONS
. = ALIGN(4); . = ALIGN(4);
__HEAP_START = .; __HEAP_START = .;
. += 0x2000; __HEAP_MAX = .; . += 0x2000; __HEAP_MAX = .;
} > ram }${RELOCATING+ > ram}
.stack (NOLOAD) : .stack (NOLOAD) :
{ {
. = ALIGN(4); . = ALIGN(4);
. += 0x6000; . += 0x6000;
__STACK_START = .; __STACK_START = .;
} > ram }${RELOCATING+ > ram}
.istack (NOLOAD) : .istack (NOLOAD) :
{ {
. = ALIGN(4); . = ALIGN(4);
. += 0x100; . += 0x100;
__ISTACK_START = .; __ISTACK_START = .;
} > ram }${RELOCATING+ > ram}
.comment 0 : { *(.comment) } .comment 0 : { *(.comment) }
@ -168,5 +178,5 @@ EOF
cat <<EOF cat <<EOF
} }
__DATA_IMAGE_START = LOADADDR(.data); ${RELOCATING+__DATA_IMAGE_START = LOADADDR(.data);}
EOF EOF

View File

@ -6,6 +6,10 @@
# are permitted in any medium without royalty provided the copyright # are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. # 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 test -z "$ENTRY" && ENTRY=_start
cat <<EOF cat <<EOF
@ -19,8 +23,9 @@ cat <<EOF
are permitted in any medium without royalty provided the copyright are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. */ notice and this notice are preserved. */
EOF
${RELOCATING+ENTRY(${ENTRY})} test -n "${RELOCATING}" && cat <<EOF
ENTRY(${ENTRY})
MEMORY MEMORY
{ {
@ -30,6 +35,9 @@ MEMORY
ram : ORIGIN = 4M, LENGTH = 10M ram : ORIGIN = 4M, LENGTH = 10M
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
/* The heap is located in near memory, to suit both the near and /* The heap is located in near memory, to suit both the near and
@ -38,21 +46,21 @@ SECTIONS
there. The alignment to 4 bytes is compatible for both the CR16C there. The alignment to 4 bytes is compatible for both the CR16C
bus width (2 bytes) and CR16CPlus bus width (4 bytes). */ bus width (2 bytes) and CR16CPlus bus width (4 bytes). */
.text : { __TEXT_START = .; *(.text) __TEXT_END = .; } > rom .text : { __TEXT_START = .; *(.text) __TEXT_END = .; }${RELOCATING+ > rom}
.rdata : { __RDATA_START = .; *(.rdata_4) *(.rdata_2) *(.rdata_1) __RDATA_END = .; } > near_rom .rdata : { __RDATA_START = .; *(.rdata_4) *(.rdata_2) *(.rdata_1) __RDATA_END = .; }${RELOCATING+ > near_rom}
.ctor ALIGN(4) : { __CTOR_LIST = .; *(.ctors) __CTOR_END = .; } > near_rom .ctor ALIGN(4) : { __CTOR_LIST = .; *(.ctors) __CTOR_END = .; }${RELOCATING+ > near_rom}
.dtor ALIGN(4) : { __DTOR_LIST = .; *(.dtors) __DTOR_END = .; } > 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 = .; } > ram AT > 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 = .; } > ram .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 = .; } > near_rom .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 = .; } > near_ram AT > 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 = .; } > near_ram .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 = .; } > near_ram .heap (NOLOAD) : { . = ALIGN(4); __HEAP_START = .; . += 0x2000; __HEAP_MAX = .; }${RELOCATING+ > near_ram}
.stack (NOLOAD) : { . = ALIGN(4); . += 0x6000; __STACK_START = .; } > ram .stack (NOLOAD) : { . = ALIGN(4); . += 0x6000; __STACK_START = .; }${RELOCATING+ > ram}
.istack (NOLOAD) : { . = ALIGN(2); . += 0x100; __ISTACK_START = .; } > ram .istack (NOLOAD) : { . = ALIGN(2); . += 0x100; __ISTACK_START = .; }${RELOCATING+ > ram}
} }
__DATA_IMAGE_START = LOADADDR(.data); ${RELOCATING+__DATA_IMAGE_START = LOADADDR(.data);}
__NDATA_IMAGE_START = LOADADDR(.ndata); ${RELOCATING+__NDATA_IMAGE_START = LOADADDR(.ndata);}
EOF EOF

View File

@ -6,6 +6,10 @@
# are permitted in any medium without royalty provided the copyright # are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. # 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 # The next line should be uncommented if it is desired to link
# without libstart.o and directly enter main. # without libstart.o and directly enter main.

View File

@ -32,6 +32,9 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
EOF
test -n "${RELOCATING}" && cat <<EOF
MEMORY MEMORY
{ {
text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE
@ -43,6 +46,9 @@ MEMORY
${HEAP_MEMORY_MSP430} ${HEAP_MEMORY_MSP430}
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
/* Bootloader. */ /* Bootloader. */
@ -51,7 +57,7 @@ SECTIONS
${RELOCATING+ PROVIDE (__boot_start = .) ; } ${RELOCATING+ PROVIDE (__boot_start = .) ; }
*(.bootloader) *(.bootloader)
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
*(.bootloader.*) ${RELOCATING+*(.bootloader.*)}
} ${RELOCATING+ > bootloader} } ${RELOCATING+ > bootloader}
/* Information memory. */ /* Information memory. */
@ -59,7 +65,7 @@ SECTIONS
{ {
*(.infomem) *(.infomem)
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
*(.infomem.*) ${RELOCATING+*(.infomem.*)}
} ${RELOCATING+ > infomem} } ${RELOCATING+ > infomem}
/* Information memory (not loaded into MPU). */ /* Information memory (not loaded into MPU). */
@ -67,7 +73,7 @@ SECTIONS
{ {
*(.infomemnobits) *(.infomemnobits)
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
*(.infomemnobits.*) ${RELOCATING+*(.infomemnobits.*)}
} ${RELOCATING+ > infomemnobits} } ${RELOCATING+ > infomemnobits}
/* Read-only sections, merged into text segment. */ /* Read-only sections, merged into text segment. */
@ -133,7 +139,7 @@ SECTIONS
/* Internal text space. */ /* Internal text space. */
.text : .text :
{ {
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);
*(SORT_NONE(.init)) *(SORT_NONE(.init))
*(SORT_NONE(.init0)) /* Start here after reset. */ *(SORT_NONE(.init0)) /* Start here after reset. */
*(SORT_NONE(.init1)) *(SORT_NONE(.init1))
@ -144,7 +150,7 @@ SECTIONS
*(SORT_NONE(.init6)) /* C++ constructors. */ *(SORT_NONE(.init6)) /* C++ constructors. */
*(SORT_NONE(.init7)) *(SORT_NONE(.init7))
*(SORT_NONE(.init8)) *(SORT_NONE(.init8))
*(SORT_NONE(.init9)) /* Call main(). */ *(SORT_NONE(.init9)) /* Call main(). */}
${CONSTRUCTING+ __ctors_start = . ; } ${CONSTRUCTING+ __ctors_start = . ; }
${CONSTRUCTING+ *(.ctors) } ${CONSTRUCTING+ *(.ctors) }
@ -153,19 +159,19 @@ SECTIONS
${CONSTRUCTING+ *(.dtors) } ${CONSTRUCTING+ *(.dtors) }
${CONSTRUCTING+ __dtors_end = . ; } ${CONSTRUCTING+ __dtors_end = . ; }
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);
*(.lower.text.* .lower.text) *(.lower.text.* .lower.text)
${RELOCATING+. = ALIGN(2);} . = ALIGN(2);}
*(.text) *(.text)
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);
*(.text.*) *(.text.*)
${RELOCATING+. = ALIGN(2);} . = ALIGN(2);
*(.text:*) *(.text:*)
*(.either.text.* .either.text) *(.either.text.* .either.text)
${RELOCATING+. = ALIGN(2);} . = ALIGN(2);
*(SORT_NONE(.fini9)) *(SORT_NONE(.fini9))
*(SORT_NONE(.fini8)) *(SORT_NONE(.fini8))
*(SORT_NONE(.fini7)) *(SORT_NONE(.fini7))
@ -178,18 +184,18 @@ SECTIONS
*(SORT_NONE(.fini0)) /* Infinite loop after program termination. */ *(SORT_NONE(.fini0)) /* Infinite loop after program termination. */
*(SORT_NONE(.fini)) *(SORT_NONE(.fini))
_etext = .; _etext = .;}
} ${RELOCATING+ > text} } ${RELOCATING+ > text}
.rodata : .rodata :
{ {
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);
*(.lower.rodata.* .lower.rodata) *(.lower.rodata.* .lower.rodata)
. = ALIGN(2); . = ALIGN(2);
*(.plt) *(.plt)}
*(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*) *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.* .const .const:*})
*(.rodata1) ${RELOCATING+*(.rodata1)
*(.either.rodata.*) *(.either.rodata) *(.either.rodata.*) *(.either.rodata)
*(.eh_frame_hdr) *(.eh_frame_hdr)
@ -230,13 +236,13 @@ SECTIONS
KEEP (*crtbegin*.o(.dtors)) KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*))) KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors)) KEEP (*(.dtors))}
} ${RELOCATING+ > text} } ${RELOCATING+ > text}
.vectors ${RELOCATING-0}: .vectors ${RELOCATING-0}:
{ {
${RELOCATING+ PROVIDE (__vectors_start = .) ; } ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
*(.vectors*) *(.vectors${RELOCATING+*})
${RELOCATING+ _vectors_end = . ; } ${RELOCATING+ _vectors_end = . ; }
} ${RELOCATING+ > vectors} } ${RELOCATING+ > vectors}
@ -244,17 +250,17 @@ SECTIONS
{ {
${RELOCATING+ PROVIDE (__data_start = .) ; } ${RELOCATING+ PROVIDE (__data_start = .) ; }
${RELOCATING+ PROVIDE (__datastart = .) ; } ${RELOCATING+ PROVIDE (__datastart = .) ; }
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);
KEEP (*(.jcr)) KEEP (*(.jcr))
*(.data.rel.ro.local) *(.data.rel.ro*) *(.data.rel.ro.local) *(.data.rel.ro*)
*(.dynamic) *(.dynamic)
${RELOCATING+. = ALIGN(2);} . = ALIGN(2);
*(.lower.data.* .lower.data) *(.lower.data.* .lower.data)}
*(.data) *(.data)
*(.data.*) ${RELOCATING+*(.data.*)
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)
KEEP (*(.gnu.linkonce.d.*personality*)) KEEP (*(.gnu.linkonce.d.*personality*))
*(.data1) *(.data1)
@ -262,26 +268,26 @@ SECTIONS
*(.either.data.* .either.data) *(.either.data.* .either.data)
*(.got.plt) *(.got) *(.got.plt) *(.got)
${RELOCATING+. = ALIGN(2);} . = ALIGN(2);
*(.sdata .sdata.* .gnu.linkonce.s.*) *(.sdata .sdata.* .gnu.linkonce.s.*)
${RELOCATING+. = ALIGN(2);} . = ALIGN(2);
${RELOCATING+ _edata = . ; } _edata = .;}
} ${RELOCATING+ > data ${RELOCATING+AT> text}} } ${RELOCATING+ > data AT> text}
__romdatastart = LOADADDR(.data); ${RELOCATING+__romdatastart = LOADADDR(.data);
__romdatacopysize = SIZEOF(.data); __romdatacopysize = SIZEOF(.data);}
.bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
{ {
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
${RELOCATING+ PROVIDE (__bss_start = .); } ${RELOCATING+ PROVIDE (__bss_start = .); }
${RELOCATING+ PROVIDE (__bssstart = .); } ${RELOCATING+ PROVIDE (__bssstart = .);
*(.lower.bss.* .lower.bss) *(.lower.bss.* .lower.bss)
${RELOCATING+. = ALIGN(2);} . = ALIGN(2);}
*(.bss) *(.bss)
*(.either.bss.* .either.bss) ${RELOCATING+*(.either.bss.* .either.bss)
*(COMMON) *(COMMON)
${RELOCATING+ PROVIDE (__bss_end = .) ; } PROVIDE (__bss_end = .);}
} ${RELOCATING+ > data} } ${RELOCATING+ > data}
${RELOCATING+ PROVIDE (__bsssize = SIZEOF(.bss)); } ${RELOCATING+ PROVIDE (__bsssize = SIZEOF(.bss)); }
@ -317,7 +323,7 @@ EOF
. $srcdir/scripttempl/DWARF.sc . $srcdir/scripttempl/DWARF.sc
cat <<EOF test -n "${RELOCATING}" && cat <<EOF
.MSP430.attributes 0 : .MSP430.attributes 0 :
{ {
KEEP (*(.MSP430.attributes)) KEEP (*(.MSP430.attributes))
@ -331,5 +337,8 @@ cat <<EOF
PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ; PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ;
PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ; PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ;
PROVIDE (__subdevice_has_heap = ${GOT_HEAP_MSP-0}) ; PROVIDE (__subdevice_has_heap = ${GOT_HEAP_MSP-0}) ;
EOF
cat <<EOF
} }
EOF EOF

View File

@ -14,6 +14,9 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
EOF
test -n "${RELOCATING}" && cat <<EOF
MEMORY MEMORY
{ {
text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE
@ -21,6 +24,9 @@ MEMORY
vectors (rw) : ORIGIN = 0xffe0, LENGTH = 0x20 vectors (rw) : ORIGIN = 0xffe0, LENGTH = 0x20
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
/* Read-only sections, merged into text segment. */ /* Read-only sections, merged into text segment. */
@ -86,7 +92,7 @@ SECTIONS
/* Internal text space. */ /* Internal text space. */
.text : .text :
{ {
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);
*(SORT_NONE(.init)) *(SORT_NONE(.init))
*(SORT_NONE(.init0)) /* Start here after reset. */ *(SORT_NONE(.init0)) /* Start here after reset. */
*(SORT_NONE(.init1)) *(SORT_NONE(.init1))
@ -97,7 +103,7 @@ SECTIONS
*(SORT_NONE(.init6)) /* C++ constructors. */ *(SORT_NONE(.init6)) /* C++ constructors. */
*(SORT_NONE(.init7)) *(SORT_NONE(.init7))
*(SORT_NONE(.init8)) *(SORT_NONE(.init8))
*(SORT_NONE(.init9)) /* Call main(). */ *(SORT_NONE(.init9)) /* Call main(). */}
${CONSTRUCTING+ __ctors_start = . ; } ${CONSTRUCTING+ __ctors_start = . ; }
${CONSTRUCTING+ *(.ctors) } ${CONSTRUCTING+ *(.ctors) }
@ -108,12 +114,12 @@ SECTIONS
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
*(.text) *(.text)
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);
*(.text.*) *(.text.*)
${RELOCATING+. = ALIGN(2);} . = ALIGN(2);
*(.text:*) *(.text:*)
${RELOCATING+. = ALIGN(2);} . = ALIGN(2);
*(SORT_NONE(.fini9)) *(SORT_NONE(.fini9))
*(SORT_NONE(.fini8)) *(SORT_NONE(.fini8))
*(SORT_NONE(.fini7)) *(SORT_NONE(.fini7))
@ -126,14 +132,14 @@ SECTIONS
*(SORT_NONE(.fini0)) /* Infinite loop after program termination. */ *(SORT_NONE(.fini0)) /* Infinite loop after program termination. */
*(SORT_NONE(.fini)) *(SORT_NONE(.fini))
${RELOCATING+ _etext = . ; } _etext = . ;}
} ${RELOCATING+ > text} } ${RELOCATING+ > text}
.rodata : .rodata :
{ {
*(.rodata .rodata.* .gnu.linkonce.r.*) *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*})
*(.const) ${RELOCATING+*(.const)}
*(.const:*) ${RELOCATING+*(.const:*)}
} ${RELOCATING+ > text} } ${RELOCATING+ > text}
.data ${RELOCATING-0} : .data ${RELOCATING-0} :
@ -141,11 +147,11 @@ SECTIONS
${RELOCATING+ PROVIDE (__data_start = .) ; } ${RELOCATING+ PROVIDE (__data_start = .) ; }
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
*(.data) *(.data)
*(.data.*) ${RELOCATING+*(.data.*)}
*(.gnu.linkonce.d*) ${RELOCATING+*(.gnu.linkonce.d*)}
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
${RELOCATING+ _edata = . ; } ${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > data ${RELOCATING+AT> text}} } ${RELOCATING+ > data AT> text}
__romdatastart = LOADADDR(.data); __romdatastart = LOADADDR(.data);
__romdatacopysize = SIZEOF(.data); __romdatacopysize = SIZEOF(.data);
@ -181,7 +187,7 @@ SECTIONS
.vectors ${RELOCATING-0}: .vectors ${RELOCATING-0}:
{ {
${RELOCATING+ PROVIDE (__vectors_start = .) ; } ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
*(.vectors*) *(.vectors${RELOCATING+*})
${RELOCATING+ _vectors_end = . ; } ${RELOCATING+ _vectors_end = . ; }
} ${RELOCATING+ > vectors} } ${RELOCATING+ > vectors}
@ -205,11 +211,14 @@ EOF
. $srcdir/scripttempl/DWARF.sc . $srcdir/scripttempl/DWARF.sc
cat <<EOF test -n "${RELOCATING}" && cat <<EOF
PROVIDE (__stack = ${STACK}) ; PROVIDE (__stack = ${STACK}) ;
PROVIDE (__data_start_rom = _etext) ; PROVIDE (__data_start_rom = _etext) ;
PROVIDE (__data_end_rom = _etext + SIZEOF (.data)) ; PROVIDE (__data_end_rom = _etext + SIZEOF (.data)) ;
PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ; PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ;
PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ; PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ;
EOF
cat <<EOF
} }
EOF EOF

View File

@ -13,7 +13,10 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
${RELOCATING+ENTRY ("_start")} EOF
test -n "${RELOCATING}" && cat <<EOF
ENTRY ("_start")
MEMORY MEMORY
{ {
@ -28,6 +31,9 @@ MEMORY
ldata : o =0x4000 ,l = 0x0200 ldata : o =0x4000 ,l = 0x0200
} }
ELF
cat <<EOF
SECTIONS SECTIONS
{ {
.init : .init :
@ -37,15 +43,15 @@ SECTIONS
.text : .text :
{ {
*(.rodata) ${RELOCATING+*(.rodata)}
*(.text.*) ${RELOCATING+*(.text.*)}
*(.text) *(.text)
${RELOCATING+ _etext = . ; } ${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > introm} } ${RELOCATING+ > introm}
.data : .data :
{ {
*(.data) *(.data)
*(.data.*) ${RELOCATING+*(.data.*)}
${RELOCATING+ _edata = . ; } ${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > dram} } ${RELOCATING+ > dram}
@ -54,7 +60,7 @@ SECTIONS
{ {
${RELOCATING+ _bss_start = . ;} ${RELOCATING+ _bss_start = . ;}
*(.bss) *(.bss)
*(COMMON) ${RELOCATING+*(COMMON)}
${RELOCATING+ _end = . ; } ${RELOCATING+ _end = . ; }
} ${RELOCATING+ > dram} } ${RELOCATING+ > dram}

View File

@ -13,7 +13,10 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
${RELOCATING+ENTRY ("_start")} EOF
test -n "${RELOCATING}" && cat <<EOF
ENTRY ("_start")
MEMORY MEMORY
{ {
vectarea : o =0xc00000, l = 0x0300 vectarea : o =0xc00000, l = 0x0300
@ -26,6 +29,9 @@ MEMORY
ldata : o =0x4000 ,l = 0x0200 ldata : o =0x4000 ,l = 0x0200
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
/*.vects : /*.vects :
@ -39,15 +45,15 @@ SECTIONS
.text : .text :
{ {
*(.rodata) ${RELOCATING+*(.rodata)}
*(.text.*) ${RELOCATING+*(.text.*)}
*(.text) *(.text)
${RELOCATING+ _etext = . ; } ${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > introm} } ${RELOCATING+ > introm}
.data : .data :
{ {
*(.data) *(.data)
*(.data.*) ${RELOCATING+*(.data.*)}
${RELOCATING+ _edata = . ; } ${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > dram} } ${RELOCATING+ > dram}
@ -56,7 +62,7 @@ SECTIONS
{ {
${RELOCATING+ _bss_start = . ;} ${RELOCATING+ _bss_start = . ;}
*(.bss) *(.bss)
*(COMMON) ${RELOCATING+*(COMMON)}
${RELOCATING+ _end = . ; } ${RELOCATING+ _end = . ; }
} ${RELOCATING+ > dram} } ${RELOCATING+ > dram}

View File

@ -13,7 +13,10 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
${RELOCATING+ENTRY ("_start")} EOF
test -n "${RELOCATING}" && cat <<EOF
ENTRY ("_start")
MEMORY MEMORY
{ {
vectarea : o =0xc00000, l = 0x0300 vectarea : o =0xc00000, l = 0x0300
@ -26,6 +29,10 @@ MEMORY
ldata : o =0x4000 ,l = 0x0200 ldata : o =0x4000 ,l = 0x0200
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
/*.vects : /*.vects :
@ -39,15 +46,15 @@ SECTIONS
.text : .text :
{ {
*(.rodata) ${RELOCATING+*(.rodata)}
*(.text.*) ${RELOCATING+*(.text.*)}
*(.text) *(.text)
${RELOCATING+ _etext = . ; } ${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > introm} } ${RELOCATING+ > introm}
.data : .data :
{ {
*(.data) *(.data)
*(.data.*) ${RELOCATING+*(.data.*)}
${RELOCATING+ _edata = . ; } ${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > dram} } ${RELOCATING+ > dram}
@ -56,7 +63,7 @@ SECTIONS
{ {
${RELOCATING+ _bss_start = . ;} ${RELOCATING+ _bss_start = . ;}
*(.bss) *(.bss)
*(COMMON) ${RELOCATING+*(COMMON)}
${RELOCATING+ _end = . ; } ${RELOCATING+ _end = . ; }
} ${RELOCATING+ > dram} } ${RELOCATING+ > dram}

View File

@ -123,7 +123,7 @@ fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
if test -z "$GOT"; then if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then if test -z "$SEPARATE_GOTPLT"; then
GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }" GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }"
else else
GOT=".got ${RELOCATING-0} : { *(.got) }" GOT=".got ${RELOCATING-0} : { *(.got) }"
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }" GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }"
@ -138,9 +138,9 @@ if test -z "${NO_SMALL_DATA}"; then
{ {
${RELOCATING+${SBSS_START_SYMBOLS}} ${RELOCATING+${SBSS_START_SYMBOLS}}
${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)} ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
*(.dynsbss) ${RELOCATING+*(.dynsbss)}
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*}) *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
*(.scommon) ${RELOCATING+*(.scommon)}
${RELOCATING+${SBSS_END_SYMBOLS}} ${RELOCATING+${SBSS_END_SYMBOLS}}
}" }"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
@ -433,7 +433,7 @@ cat <<EOF
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } .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 /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */ the same address within the page on the next page up. */
@ -443,7 +443,7 @@ cat <<EOF
/* Exception handling */ /* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } .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 */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
@ -496,15 +496,15 @@ cat <<EOF
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} : .bss ${RELOCATING-0} :
{ {
*(.dynbss) ${RELOCATING+*(.dynbss)}
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. .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. */ pad the .data section. */
${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
} }
${OTHER_BSS_SECTIONS} ${OTHER_BSS_SECTIONS}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}} ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}

View File

@ -238,7 +238,7 @@ cat <<EOF
EOF EOF
fi fi
cat <<EOF cat <<EOF
. = ALIGN(0x1000); ${RELOCATING+. = ALIGN(0x1000);}
.rel.plt ${RELOCATING-0} : { *(.rel.plt) } .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) } .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
${OTHER_PLT_RELOC_SECTIONS} ${OTHER_PLT_RELOC_SECTIONS}
@ -260,36 +260,36 @@ cat <<EOF
${RELOCATING+PROVIDE (__etext = .);} ${RELOCATING+PROVIDE (__etext = .);}
${RELOCATING+PROVIDE (_etext = .);} ${RELOCATING+PROVIDE (_etext = .);}
${RELOCATING+PROVIDE (etext = .);} ${RELOCATING+PROVIDE (etext = .);}
. = ALIGN(0x1000); ${RELOCATING+. = ALIGN(0x1000);}
${CREATE_SHLIB-${SDATA2}} ${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}} ${CREATE_SHLIB-${SBSS2}}
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
. = ALIGN(0x1000); ${RELOCATING+. = ALIGN(0x1000);}
.data ${RELOCATING-0} : .data ${RELOCATING-0} :
{ {
*(.rodata .rodata.*) ${RELOCATING+*(.rodata .rodata.*)
*(.rodata1) *(.rodata1)
*(.gnu.linkonce.r.*) *(.gnu.linkonce.r.*)
${RELOCATING+${DATA_START_SYMBOLS}} ${DATA_START_SYMBOLS}}
*(.data${RELOCATING+ .data.* .gnu.linkonce.d.*}) *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
${CONSTRUCTING+SORT(CONSTRUCTORS)} ${CONSTRUCTING+SORT(CONSTRUCTORS)}
KEEP (*(.eh_frame)) ${RELOCATING+KEEP (*(.eh_frame))
*(.gcc_except_table) *(.gcc_except_table)
${CTOR} ${CTOR}
${DTOR} ${DTOR}
KEEP (*(.jcr)) KEEP (*(.jcr))}
} }
.data1 ${RELOCATING-0} : { *(.data1) } .data1 ${RELOCATING-0} : { *(.data1) }
. = ALIGN(0x1000); ${RELOCATING+. = ALIGN(0x1000);}
.gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) } .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) }
${WRITABLE_RODATA+${RODATA}} ${WRITABLE_RODATA+${RODATA}}
${OTHER_READWRITE_SECTIONS} ${OTHER_READWRITE_SECTIONS}
${TEXT_DYNAMIC-${DYNAMIC}} ${TEXT_DYNAMIC-${DYNAMIC}}
${DATA_PLT+${PLT}} ${DATA_PLT+${PLT}}
${RELOCATING+${OTHER_GOT_SYMBOLS}} ${RELOCATING+${OTHER_GOT_SYMBOLS}}
.got ${RELOCATING-0} : { *(.got.plt) *(.got) } .got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }
${OTHER_GOT_SECTIONS} ${OTHER_GOT_SECTIONS}
${CREATE_SHLIB+${SDATA2}} ${CREATE_SHLIB+${SDATA2}}
${CREATE_SHLIB+${SBSS2}} ${CREATE_SHLIB+${SBSS2}}
@ -301,16 +301,16 @@ cat <<EOF
${RELOCATING+${OTHER_BSS_SYMBOLS}} ${RELOCATING+${OTHER_BSS_SYMBOLS}}
${SBSS} ${SBSS}
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
. = ALIGN(0x1000); ${RELOCATING+. = ALIGN(0x1000);}
.bss ${RELOCATING-0} : .bss ${RELOCATING-0} :
{ {
*(.dynbss) ${RELOCATING+*(.dynbss)}
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */ .bss section disappears because there are no input sections. */
${RELOCATING+. = ALIGN(${ALIGNMENT});} . = ALIGN(${ALIGNMENT});}
} }
${RELOCATING+${OTHER_BSS_END_SYMBOLS}} ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+. = ALIGN(${ALIGNMENT});}
@ -320,7 +320,6 @@ cat <<EOF
${STACK_ADDR+${STACK}} ${STACK_ADDR+${STACK}}
/* Stabs debugging sections. */ /* Stabs debugging sections. */
. = ALIGN(0x1000);
.stab 0 : { *(.stab) } .stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) } .stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) } .stab.excl 0 : { *(.stab.excl) }
@ -328,7 +327,6 @@ cat <<EOF
.stab.index 0 : { *(.stab.index) } .stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) } .stab.indexstr 0 : { *(.stab.indexstr) }
. = ALIGN(0x1000);
.comment 0 : { *(.comment) } .comment 0 : { *(.comment) }
EOF EOF

View File

@ -84,7 +84,7 @@ if test -n "${COMMONPAGESIZE}"; then
fi fi
INTERP=".interp ${RELOCATING-0} : { *(.interp) }" INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }" 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) }" DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }" STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
@ -93,9 +93,9 @@ if test -z "${NO_SMALL_DATA}"; then
{ {
${RELOCATING+PROVIDE (__sbss_start = .);} ${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);} ${RELOCATING+PROVIDE (___sbss_start = .);}
*(.dynsbss) ${RELOCATING+*(.dynsbss)}
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*}) *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
*(.scommon) ${RELOCATING+*(.scommon)}
${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);} ${RELOCATING+PROVIDE (___sbss_end = .);}
}" }"
@ -265,8 +265,8 @@ cat <<EOF
.jlitab ${RELOCATING-0} : .jlitab ${RELOCATING-0} :
{ {
${RELOCATING+${JLI_START_TABLE}} ${RELOCATING+${JLI_START_TABLE}}
jlitab*.o(.jlitab*) ${RELOCATING+jlitab*.o(.jlitab*)}
*(.jlitab*) *(.jlitab${RELOCATING+*})
} =${NOP-0} } =${NOP-0}
.text ${RELOCATING-0} : .text ${RELOCATING-0} :
{ {
@ -295,7 +295,7 @@ cat <<EOF
${CREATE_SHLIB-${SBSS2}} ${CREATE_SHLIB-${SBSS2}}
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .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 /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */ the same address within the page on the next page up. */
@ -304,7 +304,7 @@ cat <<EOF
${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}} ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
/* Exception handling */ /* 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 /* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but could instead move the label definition inside the section, but
@ -360,13 +360,13 @@ cat <<EOF
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} : .bss ${RELOCATING-0} :
{ {
*(.dynbss) ${RELOCATING+*(.dynbss)}
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */ .bss section disappears because there are no input sections. */
${RELOCATING+. = ALIGN(${ALIGNMENT});} . = ALIGN(${ALIGNMENT});}
} }
${OTHER_BSS_SECTIONS} ${OTHER_BSS_SECTIONS}
${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+. = ALIGN(${ALIGNMENT});}
@ -374,27 +374,31 @@ cat <<EOF
${RELOCATING+${OTHER_BSS_END_SYMBOLS}} ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+PROVIDE (end = .);} ${RELOCATING+PROVIDE (end = .);}
${RELOCATING+${DATA_SEGMENT_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 /* 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. board description file, but override it for selected test cases.
The options appear in the wrong order to do this with a single symbol - 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 ldflags comes after flags injected with per-file stanzas, and thus
the setting from ldflags prevails. */ the setting from ldflags prevails. */
.heap ${RELOCATING-0} : .heap :
{ {
${RELOCATING+ __start_heap = . ; } __start_heap = . ;
${RELOCATING+ . = . + (DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : (DEFINED(__DEFAULT_HEAP_SIZE) ? __DEFAULT_HEAP_SIZE : 20k)) ; } . = . + (DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : (DEFINED(__DEFAULT_HEAP_SIZE) ? __DEFAULT_HEAP_SIZE : 20k)) ;
${RELOCATING+ __end_heap = . ; } __end_heap = . ;
} }
${RELOCATING+. = ALIGN(0x8);} . = ALIGN(0x8);
.stack ${RELOCATING-0} : .stack :
{ {
${RELOCATING+ __stack = . ; } __stack = . ;
${RELOCATING+ . = . + (DEFINED(__STACK_SIZE) ? __STACK_SIZE : (DEFINED(__DEFAULT_STACK_SIZE) ? __DEFAULT_STACK_SIZE : 64k)) ; } . = . + (DEFINED(__STACK_SIZE) ? __STACK_SIZE : (DEFINED(__DEFAULT_STACK_SIZE) ? __DEFAULT_STACK_SIZE : 64k)) ;
${RELOCATING+ __stack_top = . ; } __stack_top = . ;
} }
EOF
cat <<EOF
/* Stabs debugging sections. */ /* Stabs debugging sections. */
.stab 0 : { *(.stab) } .stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) } .stabstr 0 : { *(.stabstr) }
@ -422,7 +426,7 @@ cat <<EOF
.debug_pubnames 0 : { *(.debug_pubnames) } .debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */ /* 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_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) } .debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) } .debug_frame 0 : { *(.debug_frame) }

View File

@ -12,7 +12,7 @@ test -z "$ENTRY" && ENTRY=start
test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT} test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_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 # 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} test "${ARC_ENDIAN}" == "big" && OUTPUT_FORMAT=${BIG_OUTPUT_FORMAT}
if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
test -z "${ELFSIZE}" && ELFSIZE=32 test -z "${ELFSIZE}" && ELFSIZE=32
@ -177,12 +177,13 @@ SECTIONS
.jcr : { KEEP (*(.jcr)) } ${RELOCATING+> ${TEXT_MEMORY}} .jcr : { KEEP (*(.jcr)) } ${RELOCATING+> ${TEXT_MEMORY}}
.eh_frame : { KEEP (*(.eh_frame)) } ${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}} .plt : { *(.plt) } ${RELOCATING+> ${TEXT_MEMORY}}
.jlitab : .jlitab :
{ {
${RELOCATING+${JLI_START_TABLE}} ${RELOCATING+${JLI_START_TABLE}}
jlitab*.o:(.jlitab*) *(.jlitab*) ${RELOCATING+jlitab*.o:(.jlitab*)}
*(.jlitab${RELOCATING+*})
} ${RELOCATING+> ${TEXT_MEMORY}} } ${RELOCATING+> ${TEXT_MEMORY}}
.rodata ${RELOCATING-0} : .rodata ${RELOCATING-0} :
@ -236,7 +237,7 @@ SECTIONS
line will have no effect, see PR13697. Thus, keep .data */ line will have no effect, see PR13697. Thus, keep .data */
KEEP (*(.data)) KEEP (*(.data))
${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+${DATA_START_SYMBOLS}}
*(.data${RELOCATING+ .data.* .gnu.linkonce.d.*}) ${RELOCATING+*(.data.* .gnu.linkonce.d.*)}
${CONSTRUCTING+SORT(CONSTRUCTORS)} ${CONSTRUCTING+SORT(CONSTRUCTORS)}
} ${RELOCATING+ > ${DATA_MEMORY}} } ${RELOCATING+ > ${DATA_MEMORY}}
@ -251,13 +252,13 @@ SECTIONS
${RELOCATING+${SBSS2}} ${RELOCATING+${SBSS2}}
.bss ${RELOCATING-0} : .bss ${RELOCATING-0} :
{ {
*(.dynbss) ${RELOCATING+*(.dynbss)}
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */ .bss section disappears because there are no input sections. */
${RELOCATING+. = ALIGN(${ALIGNMENT});} . = ALIGN(${ALIGNMENT});}
${RELOCATING+_end = .;} ${RELOCATING+_end = .;}
${RELOCATING+PROVIDE (end = .);} ${RELOCATING+PROVIDE (end = .);}
} ${RELOCATING+ > ${DATA_MEMORY}} } ${RELOCATING+ > ${DATA_MEMORY}}
@ -298,7 +299,7 @@ SECTIONS
.debug_pubnames 0 : { *(.debug_pubnames) } .debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */ /* 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_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) } .debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) } .debug_frame 0 : { *(.debug_frame) }

View File

@ -70,12 +70,15 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}") "${LITTLE_OUTPUT_FORMAT}")
OUTPUT_ARCH(${OUTPUT_ARCH}) OUTPUT_ARCH(${OUTPUT_ARCH})
${RELOCATING+ENTRY(${ENTRY})} EOF
${RELOCATING+${LIB_SEARCH_DIRS}} test -n "${RELOCATING}" && cat <<EOF
${RELOCATING+/* Do we need any of these for elf? ENTRY(${ENTRY})
__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 MEMORY
{ {
@ -94,47 +97,50 @@ MEMORY
STACK : org = 0x0200BFFC, len = 4 STACK : org = 0x0200BFFC, len = 4
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
.text ${RELOCATING+${TEXT_START_ADDR}} : .text ${RELOCATING+${TEXT_START_ADDR}} :
{ {
${RELOCATING+${TEXT_START_SYMBOLS}} ${RELOCATING+${TEXT_START_SYMBOLS}
KEEP (*(SORT_NONE(.init))) KEEP (*(SORT_NONE(.init)))
KEEP (*(SORT_NONE(.init.*))) KEEP (*(SORT_NONE(.init.*)))
KEEP (*(SORT_NONE(.fini))) KEEP (*(SORT_NONE(.fini)))
KEEP (*(SORT_NONE(.fini.*))) KEEP (*(SORT_NONE(.fini.*)))}
*(.text) *(.text)
*(.text.*) ${RELOCATING+*(.text.*)}
/* .gnu.warning sections are handled specially by elf32.em. */ /* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning) *(.gnu.warning)
*(.gnu.linkonce.t*) ${RELOCATING+*(.gnu.linkonce.t*)
${RELOCATING+_etext = .;} _etext = .;
${RELOCATING+PROVIDE (etext = .);} PROVIDE (etext = .);}
} ${RELOCATING+ >INSN} =${NOP-0} } ${RELOCATING+ >INSN} =${NOP-0}
.rodata ${RELOCATING+${READONLY_START_ADDR}} : { .rodata ${RELOCATING+${READONLY_START_ADDR}} : {
*(.rodata) *(.rodata)
*(.gnu.linkonce.r*) ${RELOCATING+*(.gnu.linkonce.r*)
*(.rodata.*) *(.rodata.*)}
} ${RELOCATING+ >DATA} } ${RELOCATING+ >DATA}
.rodata1 ${RELOCATING-0} : { .rodata1 ${RELOCATING-0} : {
*(.rodata1) *(.rodata1)
*(.rodata1.*) ${RELOCATING+*(.rodata1.*)}
} ${RELOCATING+ >DATA} } ${RELOCATING+ >DATA}
.data ${RELOCATING-0} : .data ${RELOCATING-0} :
{ {
${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+${DATA_START_SYMBOLS}}
*(.data) *(.data)
*(.data.*) ${RELOCATING+*(.data.*)
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)}
${CONSTRUCTING+CONSTRUCTORS} ${CONSTRUCTING+CONSTRUCTORS}
} ${RELOCATING+ >DATA} } ${RELOCATING+ >DATA}
.data1 ${RELOCATING-0} : { .data1 ${RELOCATING-0} : {
*(.data1) *(.data1)
*(.data1.*) ${RELOCATING+*(.data1.*)}
} ${RELOCATING+ >DATA} } ${RELOCATING+ >DATA}
${RELOCATING+${CTOR} >DATA} ${RELOCATING+${CTOR} >DATA}
@ -145,20 +151,20 @@ SECTIONS
we can shorten the on-disk segment size. */ we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : { .sdata ${RELOCATING-0} : {
*(.sdata) *(.sdata)
*(.sdata.*) ${RELOCATING+*(.sdata.*)}
} ${RELOCATING+ >DATA} } ${RELOCATING+ >DATA}
${RELOCATING+_edata = .;} ${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);} ${RELOCATING+PROVIDE (edata = .);}
${RELOCATING+__bss_start = .;} ${RELOCATING+__bss_start = .;}
.sbss ${RELOCATING-0} : { *(.sbss) *(.scommon) } ${RELOCATING+ >DATA} .sbss ${RELOCATING-0} : { *(.sbss)${RELOCATING+ *(.scommon)} } ${RELOCATING+ >DATA}
.bss ${RELOCATING-0} : .bss ${RELOCATING-0} :
{ {
*(.dynbss) ${RELOCATING+*(.dynbss)
*(.dynbss.*) *(.dynbss.*)}
*(.bss) *(.bss)
*(.bss.*) ${RELOCATING+*(.bss.*)
*(COMMON) *(COMMON)}
} ${RELOCATING+ >DATA} } ${RELOCATING+ >DATA}
${RELOCATING+_end = . ;} ${RELOCATING+_end = . ;}

View File

@ -52,6 +52,9 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
EOF
test -n "${RELOCATING}" && cat <<EOF
MEMORY MEMORY
{ {
text ${TEXT_DEF_SECTION} : ORIGIN = ${TEXT_START_ADDR}, LENGTH = ${TEXT_SIZE} text ${TEXT_DEF_SECTION} : ORIGIN = ${TEXT_START_ADDR}, LENGTH = ${TEXT_SIZE}
@ -60,6 +63,9 @@ MEMORY
eit : ORIGIN = ${EIT_START_ADDR}, LENGTH = ${EIT_SIZE} eit : ORIGIN = ${EIT_START_ADDR}, LENGTH = ${EIT_SIZE}
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
/* Read-only sections, merged into text segment: */ /* Read-only sections, merged into text segment: */
@ -71,12 +77,12 @@ SECTIONS
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
.rel.text ${RELOCATING-0} : { *(.rel.text) *(.rel.gnu.linkonce.t*) } .rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.gnu.linkonce.t*}) }
.rela.text ${RELOCATING-0} : { *(.rela.text) *(.rela.gnu.linkonce.t*) } .rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.gnu.linkonce.t*}) }
.rel.data ${RELOCATING-0} : { *(.rel.data) *(.rel.gnu.linkonce.d*) } .rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.gnu.linkonce.d*}) }
.rela.data ${RELOCATING-0} : { *(.rela.data) *(.rela.gnu.linkonce.d*) } .rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.gnu.linkonce.d*}) }
.rel.rodata ${RELOCATING-0} : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } .rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.gnu.linkonce.r*}) }
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } .rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.gnu.linkonce.r*}) }
.rel.stext ${RELOCATING-0} : { *(.rel.stest) } .rel.stext ${RELOCATING-0} : { *(.rel.stest) }
.rela.stext ${RELOCATING-0} : { *(.rela.stest) } .rela.stext ${RELOCATING-0} : { *(.rela.stest) }
.rel.etext ${RELOCATING-0} : { *(.rel.etest) } .rel.etext ${RELOCATING-0} : { *(.rel.etest) }
@ -120,10 +126,10 @@ SECTIONS
.text : .text :
{ {
*(.text) *(.text)
*(.gnu.linkonce.t*) ${RELOCATING+*(.gnu.linkonce.t*)
*(SORT_NONE(.init)) *(SORT_NONE(.init))
*(SORT_NONE(.fini)) *(SORT_NONE(.fini))
${RELOCATING+ _etext = . ; } _etext = . ;}
} ${RELOCATING+ > ${TEXT_MEMORY}} } ${RELOCATING+ > ${TEXT_MEMORY}}
/* Internal data space */ /* Internal data space */
@ -146,7 +152,7 @@ SECTIONS
.data ${RELOCATING-0} : .data ${RELOCATING-0} :
{ {
*(.data) *(.data)
*(.gnu.linkonce.d*) ${RELOCATING+*(.gnu.linkonce.d*)}
${CONSTRUCTING+CONSTRUCTORS} ${CONSTRUCTING+CONSTRUCTORS}
${RELOCATING+ _edata = . ; } ${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > ${DATA_MEMORY}} } ${RELOCATING+ > ${DATA_MEMORY}}
@ -180,7 +186,7 @@ SECTIONS
{ {
${RELOCATING+ PROVIDE (__bss_start = .) ; } ${RELOCATING+ PROVIDE (__bss_start = .) ; }
*(.bss) *(.bss)
*(COMMON) ${RELOCATING+*(COMMON)}
${RELOCATING+ PROVIDE (__bss_end = .) ; } ${RELOCATING+ PROVIDE (__bss_end = .) ; }
${RELOCATING+ _end = . ; } ${RELOCATING+ _end = . ; }
} ${RELOCATING+ > ${DATA_MEMORY}} } ${RELOCATING+ > ${DATA_MEMORY}}
@ -207,10 +213,9 @@ EOF
. $srcdir/scripttempl/DWARF.sc . $srcdir/scripttempl/DWARF.sc
cat <<EOF cat <<EOF
PROVIDE (__stack = ${STACK_START_ADDR}); ${RELOCATING+PROVIDE (__stack = ${STACK_START_ADDR});}
} }
EOF EOF

View File

@ -410,12 +410,11 @@ SECTIONS
${RELOCATING+__bss_start = .;} ${RELOCATING+__bss_start = .;}
${RELOCATING+*(.sbss)} ${RELOCATING+*(.sbss)}
${RELOCATING+*(.scommon)} ${RELOCATING+*(.scommon)}
${RELOCATING+*(.dynbss)}
*(.dynbss)
*(.bss) *(.bss)
${RELOCATING+*(.bss.*)} ${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)} ${RELOCATING+*(.gnu.linkonce.b.*)}
*(COMMON) ${RELOCATING+*(COMMON)}
${RELOCATING+PROVIDE (_end = .);} ${RELOCATING+PROVIDE (_end = .);}
} ${RELOCATING+ > ${DATA_MEMORY}} } ${RELOCATING+ > ${DATA_MEMORY}}
${RELOCATING+__bss_size = SIZEOF(.bss);} ${RELOCATING+__bss_size = SIZEOF(.bss);}
@ -424,7 +423,7 @@ SECTIONS
.eeprom ${RELOCATING-0} : .eeprom ${RELOCATING-0} :
{ {
*(.eeprom) *(.eeprom)
*(.eeprom.*) ${RELOCATING+*(.eeprom.*)}
} ${RELOCATING+ > ${EEPROM_MEMORY}} } ${RELOCATING+ > ${EEPROM_MEMORY}}
${RELOCATING+${VECTORS}} ${RELOCATING+${VECTORS}}

View File

@ -413,12 +413,11 @@ SECTIONS
${RELOCATING+*(.softregs)} ${RELOCATING+*(.softregs)}
${RELOCATING+*(.sbss)} ${RELOCATING+*(.sbss)}
${RELOCATING+*(.scommon)} ${RELOCATING+*(.scommon)}
${RELOCATING+*(.dynbss)}
*(.dynbss)
*(.bss) *(.bss)
${RELOCATING+*(.bss.*)} ${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)} ${RELOCATING+*(.gnu.linkonce.b.*)}
*(COMMON) ${RELOCATING+*(COMMON)}
${RELOCATING+PROVIDE (_end = .);} ${RELOCATING+PROVIDE (_end = .);}
} ${RELOCATING+ > ${DATA_MEMORY}} } ${RELOCATING+ > ${DATA_MEMORY}}
${RELOCATING+__bss_size = SIZEOF(.bss);} ${RELOCATING+__bss_size = SIZEOF(.bss);}
@ -427,7 +426,7 @@ SECTIONS
.eeprom ${RELOCATING-0} : .eeprom ${RELOCATING-0} :
{ {
*(.eeprom) *(.eeprom)
*(.eeprom.*) ${RELOCATING+*(.eeprom.*)}
} ${RELOCATING+ > ${EEPROM_MEMORY}} } ${RELOCATING+ > ${EEPROM_MEMORY}}
${RELOCATING+${VECTORS}} ${RELOCATING+${VECTORS}}

View File

@ -173,7 +173,7 @@ ${RELOCATING+${LIB_SEARCH_DIRS}}
${RELOCATING+${EXECUTABLE_SYMBOLS}} ${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING+${MEMORY_DEF}} ${RELOCATING+${MEMORY_DEF}}
PROVIDE (_start = $[$ROM_TOP - $ROM_SIZE + 1]); ${RELOCATING+PROVIDE (_start = $[$ROM_TOP - $ROM_SIZE + 1]);}
SECTIONS SECTIONS
{ {
.hash ${RELOCATING-0} : { *(.hash) } .hash ${RELOCATING-0} : { *(.hash) }
@ -403,12 +403,11 @@ SECTIONS
${RELOCATING+*(.sbss)} ${RELOCATING+*(.sbss)}
${RELOCATING+*(.common)} ${RELOCATING+*(.common)}
${RELOCATING+*(.scommon)} ${RELOCATING+*(.scommon)}
${RELOCATING+*(.dynbss)}
*(.dynbss)
*(.bss) *(.bss)
${RELOCATING+*(.bss.*)} ${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)} ${RELOCATING+*(.gnu.linkonce.b.*)}
*(COMMON) ${RELOCATING+*(COMMON)}
${RELOCATING+PROVIDE (_end = .);} ${RELOCATING+PROVIDE (_end = .);}
} ${RELOCATING+ > ${DATA_MEMORY}} } ${RELOCATING+ > ${DATA_MEMORY}}
${RELOCATING+__bss_size = SIZEOF(.bss);} ${RELOCATING+__bss_size = SIZEOF(.bss);}
@ -417,7 +416,7 @@ SECTIONS
.eeprom ${RELOCATING-0} : .eeprom ${RELOCATING-0} :
{ {
*(.eeprom) *(.eeprom)
*(.eeprom.*) ${RELOCATING+*(.eeprom.*)}
} ${RELOCATING+ > ${EEPROM_MEMORY}} } ${RELOCATING+ > ${EEPROM_MEMORY}}
${RELOCATING+${VECTORS}} ${RELOCATING+${VECTORS}}

View File

@ -63,9 +63,9 @@ ${RELOCATING+${LIB_SEARCH_DIRS}}
${RELOCATING+ENTRY (${ENTRY})} ${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; _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 SECTIONS
{ {
@ -79,7 +79,7 @@ SECTIONS
${RELOCATING+ _ftext = .;} ${RELOCATING+ _ftext = .;}
.text : { .text : {
${RELOCATING+*(.text)} *(.text)
${RELOCATING+*(.text.*)} ${RELOCATING+*(.text.*)}
${RELOCATING+*(.gnu.linkonce.t.*)} ${RELOCATING+*(.gnu.linkonce.t.*)}
} }
@ -103,10 +103,10 @@ SECTIONS
${RELOCATING+ . = ALIGN(4);} ${RELOCATING+ . = ALIGN(4);}
${RELOCATING+ _frodata = . ;} ${RELOCATING+ _frodata = . ;}
.rodata : { .rodata : {
${RELOCATING+*(.rodata)} *(.rodata)
${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.rodata.*)}
${RELOCATING+*(.gnu.linkonce.r.*)} ${RELOCATING+*(.gnu.linkonce.r.*)}
${CONSTRUCTING+CONSTRUCTORS}; /* Is this needed? */ ${CONSTRUCTING+CONSTRUCTORS;} /* Is this needed? */
} }
${RELOCATING+ _erodata = .;} ${RELOCATING+ _erodata = .;}
@ -115,14 +115,14 @@ SECTIONS
${RELOCATING+. = ALIGN(8);} ${RELOCATING+. = ALIGN(8);}
${RELOCATING+ _ssrw = .;} ${RELOCATING+ _ssrw = .;}
.sdata2 : { .sdata2 : {
${RELOCATING+*(.sdata2)} *(.sdata2)
${RELOCATING+*(.sdata2.*)} ${RELOCATING+*(.sdata2.*)}
${RELOCATING+*(.gnu.linkonce.s2.*)} ${RELOCATING+*(.gnu.linkonce.s2.*)}
} }
${RELOCATING+. = ALIGN(4);} ${RELOCATING+. = ALIGN(4);}
.sbss2 : { .sbss2 : {
${RELOCATING+PROVIDE (__sbss2_start = .);} ${RELOCATING+PROVIDE (__sbss2_start = .);}
${RELOCATING+*(.sbss2)} *(.sbss2)
${RELOCATING+*(.sbss2.*)} ${RELOCATING+*(.sbss2.*)}
${RELOCATING+*(.gnu.linkonce.sb2.*)} ${RELOCATING+*(.gnu.linkonce.sb2.*)}
${RELOCATING+PROVIDE (__sbss2_end = .);} ${RELOCATING+PROVIDE (__sbss2_end = .);}
@ -135,36 +135,36 @@ SECTIONS
${RELOCATING+ . = ALIGN(4);} ${RELOCATING+ . = ALIGN(4);}
${RELOCATING+ _fdata = .;} ${RELOCATING+ _fdata = .;}
.data : { .data : {
${RELOCATING+*(.data)} *(.data)
${RELOCATING+*(.gnu.linkonce.d.*)} ${RELOCATING+*(.gnu.linkonce.d.*)}
${CONSTRUCTING+CONSTRUCTORS}; /* Is this needed? */ ${CONSTRUCTING+CONSTRUCTORS;} /* Is this needed? */
} }
${RELOCATING+ _edata = . ;} ${RELOCATING+ _edata = . ;}
/* Added to handle pic code */ /* Added to handle pic code */
.got : { .got : {
${RELOCATING+*(.got)} *(.got)
} }
.got1 : { .got1 : {
${RELOCATING+*(.got1)} *(.got1)
} }
.got2 : { .got2 : {
${RELOCATING+*(.got2)} *(.got2)
} }
/* Added by Sathya to handle C++ exceptions */ /* Added by Sathya to handle C++ exceptions */
.eh_frame : { .eh_frame : {
${RELOCATING+*(.eh_frame)} *(.eh_frame)
} }
.jcr : { .jcr : {
${RELOCATING+*(.jcr)} *(.jcr)
} }
.gcc_except_table : { .gcc_except_table : {
${RELOCATING+*(.gcc_except_table)} *(.gcc_except_table)
} }
/* Alignments by 8 to ensure that _SDA_BASE_ on a word boundary */ /* Alignments by 8 to ensure that _SDA_BASE_ on a word boundary */
@ -172,14 +172,14 @@ SECTIONS
${RELOCATING+. = ALIGN(8);} ${RELOCATING+. = ALIGN(8);}
${RELOCATING+ _ssro = .;} ${RELOCATING+ _ssro = .;}
.sdata : { .sdata : {
${RELOCATING+*(.sdata)} *(.sdata)
${RELOCATING+*(.sdata.*)} ${RELOCATING+*(.sdata.*)}
${RELOCATING+*(.gnu.linkonce.s.*)} ${RELOCATING+*(.gnu.linkonce.s.*)}
} }
${RELOCATING+. = ALIGN(4);} ${RELOCATING+. = ALIGN(4);}
.sbss : { .sbss : {
${RELOCATING+PROVIDE (__sbss_start = .);} ${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+*(.sbss)} *(.sbss)
${RELOCATING+*(.sbss.*)} ${RELOCATING+*(.sbss.*)}
${RELOCATING+*(.gnu.linkonce.sb.*)} ${RELOCATING+*(.gnu.linkonce.sb.*)}
${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (__sbss_end = .);}
@ -193,14 +193,13 @@ SECTIONS
${RELOCATING+ _fbss = .;} ${RELOCATING+ _fbss = .;}
.bss : { .bss : {
${RELOCATING+PROVIDE (__bss_start = .);} ${RELOCATING+PROVIDE (__bss_start = .);}
${RELOCATING+*(.bss)} *(.bss)
${RELOCATING+*(.bss.*)} ${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)} ${RELOCATING+*(.gnu.linkonce.b.*)}
${RELOCATING+*(COMMON)} ${RELOCATING+*(COMMON)}
${RELOCATING+. = ALIGN(. != 0 ? 4 : 1);} ${RELOCATING+. = ALIGN(. != 0 ? 4 : 1);}
${RELOCATING+PROVIDE (__bss_end = .);} ${RELOCATING+PROVIDE (__bss_end = .);}
} }
${RELOCATING+ . = ALIGN(4);} ${RELOCATING+ . = ALIGN(4);}
@ -223,12 +222,12 @@ SECTIONS
} }
.tdata : { .tdata : {
${RELOCATING+*(.tdata)} *(.tdata)
${RELOCATING+*(.tdata.*)} ${RELOCATING+*(.tdata.*)}
${RELOCATING+*(.gnu.linkonce.td.*)} ${RELOCATING+*(.gnu.linkonce.td.*)}
} }
.tbss : { .tbss : {
${RELOCATING+*(.tbss)} *(.tbss)
${RELOCATING+*(.tbss.*)} ${RELOCATING+*(.tbss.*)}
${RELOCATING+*(.gnu.linkonce.tb.*)} ${RELOCATING+*(.gnu.linkonce.tb.*)}
} }

View File

@ -413,12 +413,11 @@ SECTIONS
${RELOCATING+*(.softregs)} ${RELOCATING+*(.softregs)}
${RELOCATING+*(.sbss)} ${RELOCATING+*(.sbss)}
${RELOCATING+*(.scommon)} ${RELOCATING+*(.scommon)}
${RELOCATING+*(.dynbss)}
*(.dynbss)
*(.bss) *(.bss)
${RELOCATING+*(.bss.*)} ${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)} ${RELOCATING+*(.gnu.linkonce.b.*)}
*(COMMON) ${RELOCATING+*(COMMON)}
${RELOCATING+PROVIDE (_end = .);} ${RELOCATING+PROVIDE (_end = .);}
} ${RELOCATING+ > ${DATA_MEMORY}} } ${RELOCATING+ > ${DATA_MEMORY}}
${RELOCATING+__bss_size = SIZEOF(.bss);} ${RELOCATING+__bss_size = SIZEOF(.bss);}
@ -427,7 +426,7 @@ SECTIONS
.eeprom ${RELOCATING-0} : .eeprom ${RELOCATING-0} :
{ {
*(.eeprom) *(.eeprom)
*(.eeprom.*) ${RELOCATING+*(.eeprom.*)}
} ${RELOCATING+ > ${EEPROM_MEMORY}} } ${RELOCATING+ > ${EEPROM_MEMORY}}
${RELOCATING+${VECTORS}} ${RELOCATING+${VECTORS}}

View File

@ -136,7 +136,7 @@ fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
if test -z "$GOT"; then if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then if test -z "$SEPARATE_GOTPLT"; then
GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }" GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }"
else else
GOT=".got ${RELOCATING-0} : { *(.got) }" GOT=".got ${RELOCATING-0} : { *(.got) }"
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }" GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }"
@ -410,7 +410,7 @@ cat <<EOF
${TINY_READONLY_SECTION} ${TINY_READONLY_SECTION}
.text ${RELOCATING-0} : .text ${RELOCATING-0} :
{ {
*(.got.plt* .plt*) ${RELOCATING+*(.got.plt* .plt*)}
${RELOCATING+${INIT_START}} ${RELOCATING+${INIT_START}}
${RELOCATING+KEEP (*(.init.literal))} ${RELOCATING+KEEP (*(.init.literal))}
@ -442,7 +442,7 @@ cat <<EOF
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } .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 /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */ the same address within the page on the next page up. */
@ -452,7 +452,7 @@ cat <<EOF
/* Exception handling */ /* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } .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 */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
@ -506,15 +506,15 @@ cat <<EOF
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} : .bss ${RELOCATING-0} :
{ {
*(.dynbss) ${RELOCATING+*(.dynbss)}
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. .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. */ pad the .data section. */
${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
} }
${OTHER_BSS_SECTIONS} ${OTHER_BSS_SECTIONS}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}} ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}

View File

@ -123,7 +123,7 @@ fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
if test -z "$GOT"; then if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then if test -z "$SEPARATE_GOTPLT"; then
GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }" GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }"
else else
GOT=".got ${RELOCATING-0} : { *(.got) }" GOT=".got ${RELOCATING-0} : { *(.got) }"
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }" GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) }"
@ -138,9 +138,9 @@ if test -z "${NO_SMALL_DATA}"; then
{ {
${RELOCATING+${SBSS_START_SYMBOLS}} ${RELOCATING+${SBSS_START_SYMBOLS}}
${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)} ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
*(.dynsbss) ${RELOCATING+*(.dynsbss)}
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*}) *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
*(.scommon) ${RELOCATING+*(.scommon)}
${RELOCATING+${SBSS_END_SYMBOLS}} ${RELOCATING+${SBSS_END_SYMBOLS}}
}" }"
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
@ -150,7 +150,7 @@ if test -z "${NO_SMALL_DATA}"; then
.sdata ${RELOCATING-0} : .sdata ${RELOCATING-0} :
{ {
${RELOCATING+${SDATA_START_SYMBOLS}} ${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.*}) *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
}" }"
SDATA2=".sdata2 ${RELOCATING-0} : SDATA2=".sdata2 ${RELOCATING-0} :
@ -191,9 +191,9 @@ test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS="
${OTHER_BSS_SECTIONS} ${OTHER_BSS_SECTIONS}
.lbss ${RELOCATING-0} : .lbss ${RELOCATING-0} :
{ {
*(.dynlbss) ${RELOCATING+*(.dynlbss)}
*(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*}) *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
*(LARGE_COMMON) ${RELOCATING+*(LARGE_COMMON)}
}" }"
test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
.lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} : .lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
@ -259,16 +259,13 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}") "${LITTLE_OUTPUT_FORMAT}")
OUTPUT_ARCH(${OUTPUT_ARCH}) OUTPUT_ARCH(${OUTPUT_ARCH})
${RELOCATING+ENTRY(${ENTRY})} EOF
${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. */}
test -n "${RELOCATING}" && cat <<EOF
ENTRY(${ENTRY})
${EXECUTABLE_SYMBOLS}
${INPUT_FILES}
/* BSP specific*/ /* BSP specific*/
__PROG_SIZE_FOR_CORE__ = 1M; __PROG_SIZE_FOR_CORE__ = 1M;
@ -284,8 +281,8 @@ __FIRST_CORE_COL_ = 0x24;
PROVIDE (__CORE_ROW_ = __FIRST_CORE_ROW_); PROVIDE (__CORE_ROW_ = __FIRST_CORE_ROW_);
PROVIDE (__CORE_COL_ = __FIRST_CORE_COL_); PROVIDE (__CORE_COL_ = __FIRST_CORE_COL_);
/* generic don't touch */ /* generic do not touch */
/* used to calculated the slice address in the external memory*/ /* 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_ ) ; __CORE_NUM_ = (__CORE_ROW_ - __FIRST_CORE_ROW_ )* __MAX_NUM_CORES_IN_COLS__ + (__CORE_COL_ - __FIRST_CORE_COL_ ) ;
@ -331,10 +328,14 @@ MEMORY
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
EOF
test -n "${RELOCATING}" && cat <<EOF
IVT 0 : {*.o(IVT) } > RESERVED_CRT0_RAM IVT 0 : {*.o(IVT) } > RESERVED_CRT0_RAM
RESERVED_CRT0 : {*.o(RESERVED_CRT0) } > RESERVED_CRT0_RAM RESERVED_CRT0 : {*.o(RESERVED_CRT0) } > RESERVED_CRT0_RAM
RESERVED_CRT0 : {*.o(reserved_crt0) } > RESERVED_CRT0_RAM RESERVED_CRT0 : {*.o(reserved_crt0) } > RESERVED_CRT0_RAM
@ -354,7 +355,7 @@ SECTIONS
__new_lib_start_external_ = ( ORIGIN(EXTERNAL_DRAM_0) + __PROG_SIZE_FOR_CORE__ *__CORE_NUM_ ); __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_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) : { GNU_C_BUILTIN_LIB_RO ADDR(NEW_LIB_RO) + SIZEOF(NEW_LIB_RO) : {
*mulsi3.o(.text .rodata) *modsi3.o(.text .rodata) *mulsi3.o(.text .rodata) *modsi3.o(.text .rodata)
*divsi3.o(.text .rodata) *udivsi3.o(.text .rodata) *divsi3.o(.text .rodata) *udivsi3.o(.text .rodata)
@ -366,8 +367,9 @@ SECTIONS
__init_start = DEFINED(__USE_INTERNAL_MEM_) ? ORIGIN(BANK1_SRAM) : (ADDR(NEW_LIB_WR) + SIZEOF(NEW_LIB_WR) ) ; __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; __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: */ /* Read-only sections, merged into text segment: */
/*${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}*/ /*${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}*/
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}} ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
@ -467,12 +469,12 @@ fi
cat <<EOF cat <<EOF
.init __init_start : .init ${RELOCATING+__init_start} :
{ {
${RELOCATING+${INIT_START}} ${RELOCATING+${INIT_START}}
KEEP (*(.init)) KEEP (*(.init))
${RELOCATING+${INIT_END}} ${RELOCATING+${INIT_END}}
} /*> INTERNAL_RAM*/ =${NOP-0} } /* ${RELOCATING+ > INTERNAL_RAM} */ =${NOP-0}
${TEXT_PLT+${PLT}} ${TEXT_PLT+${PLT}}
${TINY_READONLY_SECTION} ${TINY_READONLY_SECTION}
@ -482,7 +484,7 @@ cat <<EOF
${RELOCATING+${FINI_START}} ${RELOCATING+${FINI_START}}
KEEP (*(.fini)) KEEP (*(.fini))
${RELOCATING+${FINI_END}} ${RELOCATING+${FINI_END}}
} /*> INTERNAL_RAM*/ =${NOP-0} } /* ${RELOCATING+ > INTERNAL_RAM} */ =${NOP-0}
.text ${RELOCATING+ADDR(.fini)+SIZEOF(.fini)} ${RELOCATING-0} : .text ${RELOCATING+ADDR(.fini)+SIZEOF(.fini)} ${RELOCATING-0} :
{ {
@ -491,7 +493,7 @@ cat <<EOF
/* .gnu.warning sections are handled specially by elf32.em. */ /* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning) *(.gnu.warning)
${RELOCATING+${OTHER_TEXT_SECTIONS}} ${RELOCATING+${OTHER_TEXT_SECTIONS}}
} /*> INTERNAL_RAM */ =${NOP-0} } /* ${RELOCATING+ > INTERNAL_RAM} */ =${NOP-0}
${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);} ${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);}
${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);} ${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
@ -503,7 +505,7 @@ cat <<EOF
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } .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 /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */ the same address within the page on the next page up. */
@ -513,7 +515,7 @@ cat <<EOF
/* Exception handling */ /* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } .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 */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
@ -528,7 +530,7 @@ cat <<EOF
.init_array ${RELOCATING-0} : .init_array ${RELOCATING-0} :
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}}
KEEP (*(SORT(.init_array.*))) ${RELOCATING+KEEP (*(SORT(.init_array.*)))}
KEEP (*(.init_array)) KEEP (*(.init_array))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}}
} }
@ -536,7 +538,7 @@ cat <<EOF
{ {
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}}
KEEP (*(.fini_array)) KEEP (*(.fini_array))
KEEP (*(SORT(.fini_array.*))) ${RELOCATING+KEEP (*(SORT(.fini_array.*)))}
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}} ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}}
} }
${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}} ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
@ -560,7 +562,7 @@ cat <<EOF
${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+${DATA_START_SYMBOLS}}
*(.data${RELOCATING+ .data.* .gnu.linkonce.d.*}) *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
${CONSTRUCTING+SORT(CONSTRUCTORS)} ${CONSTRUCTING+SORT(CONSTRUCTORS)}
} /*> INTERNAL_RAM*/ } /* ${RELOCATING+ > INTERNAL_RAM} */
.data1 ${RELOCATING-0} : { *(.data1) } .data1 ${RELOCATING-0} : { *(.data1) }
${WRITABLE_RODATA+${RODATA}} ${WRITABLE_RODATA+${RODATA}}
${OTHER_READWRITE_SECTIONS} ${OTHER_READWRITE_SECTIONS}
@ -583,16 +585,16 @@ cat <<EOF
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING+ADDR(.rodata)+SIZEOF(.rodata)} ${RELOCATING-0} : .bss ${RELOCATING+ADDR(.rodata)+SIZEOF(.rodata)} ${RELOCATING-0} :
{ {
*(.dynbss) ${RELOCATING+*(.dynbss)}
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. .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. */ pad the .data section. */
${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
} /*> INTERNAL_RAM*/ } /* ${RELOCATING+ > INTERNAL_RAM} */
${OTHER_BSS_SECTIONS} ${OTHER_BSS_SECTIONS}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}} ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+. = ALIGN(${ALIGNMENT});}
@ -603,11 +605,11 @@ cat <<EOF
${RELOCATING+${END_SYMBOLS-${USER_LABEL_PREFIX}_end = .; PROVIDE (${USER_LABEL_PREFIX}end = .);}} ${RELOCATING+${END_SYMBOLS-${USER_LABEL_PREFIX}_end = .; PROVIDE (${USER_LABEL_PREFIX}end = .);}}
${RELOCATING+${DATA_SEGMENT_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) } .stack ${RELOCATING+__stack_start_} : { ${RELOCATING+___stack = .;} *(.stack) }
PROVIDE ( ___heap_start = ORIGIN(EXTERNAL_DRAM_1) + __HEAP_SIZE_FOR_CORE__ * __CORE_NUM_ ); ${RELOCATING+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_end = ORIGIN(EXTERNAL_DRAM_1) + __HEAP_SIZE_FOR_CORE__ * __CORE_NUM_ + __HEAP_SIZE_FOR_CORE__ - 4 );}
EOF EOF
if test -n "${NON_ALLOC_DYN}"; then if test -n "${NON_ALLOC_DYN}"; then

View File

@ -7,13 +7,15 @@ TORS=".tors :
*(.dtors) *(.dtors)
___dtors_end = . ; ___dtors_end = . ;
. = ALIGN(4); . = ALIGN(4);
} > ram" } ${RELOCATING+ > ram}"
cat <<EOF cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
${LIB_SEARCH_DIRS} ${LIB_SEARCH_DIRS}
EOF
test -n "${RELOCATING}" && cat <<EOF
/* Allow the command line to override the memory region sizes. */ /* Allow the command line to override the memory region sizes. */
__PMSIZE = DEFINED(__PMSIZE) ? __PMSIZE : 256K; __PMSIZE = DEFINED(__PMSIZE) ? __PMSIZE : 256K;
__RAMSIZE = DEFINED(__RAMSIZE) ? __RAMSIZE : 64K; __RAMSIZE = DEFINED(__RAMSIZE) ? __RAMSIZE : 64K;
@ -23,35 +25,37 @@ MEMORY
flash (rx) : ORIGIN = 0, LENGTH = __PMSIZE flash (rx) : ORIGIN = 0, LENGTH = __PMSIZE
ram (rw!x) : ORIGIN = 0x800000, LENGTH = __RAMSIZE ram (rw!x) : ORIGIN = 0x800000, LENGTH = __RAMSIZE
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
.text : .text :
{ {
*(.text*) *(.text${RELOCATING+*})
*(.strings) ${RELOCATING+*(.strings)
*(._pm*) *(._pm*)
*(.init) *(.init)
*(.fini) *(.fini)
${RELOCATING+ _etext = . ; } _etext = .;
. = ALIGN(4); . = ALIGN(4);}
} ${RELOCATING+ > flash} } ${RELOCATING+ > flash}
${CONSTRUCTING+${TORS}} ${CONSTRUCTING+${TORS}}
.data : ${RELOCATING+ AT (ADDR (.text) + SIZEOF (.text))} .data : ${RELOCATING+ AT (ADDR (.text) + SIZEOF (.text))}
{ {
*(.data) *(.data)
*(.rodata) ${RELOCATING+*(.rodata)
*(.rodata*) *(.rodata*)
${RELOCATING+ _edata = . ; } _edata = .;
. = ALIGN(4); . = ALIGN(4);}
} ${RELOCATING+ > ram} } ${RELOCATING+ > ram}
.bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
{ {
${RELOCATING+ _bss_start = . ; } ${RELOCATING+ _bss_start = . ; }
*(.bss) *(.bss)
*(COMMON) ${RELOCATING+*(COMMON)
${RELOCATING+ _end = . ; } _end = .;
. = ALIGN(4); . = ALIGN(4);}
} ${RELOCATING+ > ram} } ${RELOCATING+ > ram}
${RELOCATING+ __data_load_start = LOADADDR(.data); } ${RELOCATING+ __data_load_start = LOADADDR(.data); }

View File

@ -22,30 +22,30 @@ SECTIONS
{ {
.text 0x1000 ${RELOCATING++${TEXT_START_ADDR}}: .text 0x1000 ${RELOCATING++${TEXT_START_ADDR}}:
{ {
${RELOCATING+__text_start = .}; ${RELOCATING+__text_start = .;
CREATE_OBJECT_SYMBOLS CREATE_OBJECT_SYMBOLS}
*(.PARISC.stubs) *(.PARISC.stubs)
*(.text) *(.text)
${RELOCATING+etext = .}; ${RELOCATING+etext = .;
${RELOCATING+_etext = .}; _etext = .;}
} }
${RELOCATING+. = ${DATA_ADDR};} ${RELOCATING+. = ${DATA_ADDR};}
.data : .data :
{ {
${RELOCATING+ . = . + 0x1000 }; ${RELOCATING+. = . + 0x1000;
${RELOCATING+__data_start = .}; __data_start = .;}
*(.data) *(.data)
${CONSTRUCTING+CONSTRUCTORS} ${CONSTRUCTING+CONSTRUCTORS}
${RELOCATING+edata = .}; ${RELOCATING+edata = .;
${RELOCATING+_edata = .}; _edata = .;}
} }
${RELOCATING+. = ${DATA_ADDR} + SIZEOF(.data);} ${RELOCATING+. = ${DATA_ADDR} + SIZEOF(.data);}
.bss : .bss :
{ {
*(.bss) *(.bss)
*(COMMON) ${RELOCATING+*(COMMON)
${RELOCATING+end = . }; end = .;
${RELOCATING+_end = . }; _end = .;}
} }
} }
EOF EOF

View File

@ -7,6 +7,10 @@
# are permitted in any medium without royalty provided the copyright # are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. # 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 PAGESIZE=0x10000
BLOCKSIZE=0x200 BLOCKSIZE=0x200

View File

@ -4,6 +4,9 @@
# are permitted in any medium without royalty provided the copyright # are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. # 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 cat << EOF
/* Copyright (C) 2014-2018 Free Software Foundation, Inc. /* Copyright (C) 2014-2018 Free Software Foundation, Inc.

View File

@ -333,9 +333,9 @@ cat <<EOF
{ {
${RELOCATING+PROVIDE (__eh_frame_begin = .);} ${RELOCATING+PROVIDE (__eh_frame_begin = .);}
*(.eh_frame) *(.eh_frame)
LONG (0); ${RELOCATING+LONG (0);}
${RELOCATING+PROVIDE (__eh_frame_end = .);} ${RELOCATING+PROVIDE (__eh_frame_end = .);}
} ${RELOCATING+} }
.gcc_except_table : { *(.gcc_except_table) } .gcc_except_table : { *(.gcc_except_table) }
${INITIAL_READONLY_SECTIONS} ${INITIAL_READONLY_SECTIONS}
.hash ${RELOCATING-0} : { *(.hash) } .hash ${RELOCATING-0} : { *(.hash) }
@ -356,7 +356,7 @@ cat <<EOF
.jcr : { KEEP (*(.jcr)) } .jcr : { KEEP (*(.jcr)) }
${DATA_PLT+${PLT}} ${DATA_PLT+${PLT}}
${RELOCATING+${OTHER_GOT_SYMBOLS}} ${RELOCATING+${OTHER_GOT_SYMBOLS}}
.got ${RELOCATING-0} : { *(.got.plt) *(.got) } .got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }
${RELOCATING+${OTHER_GOT_SECTIONS}} ${RELOCATING+${OTHER_GOT_SECTIONS}}
${CREATE_SHLIB+${SDATA2}} ${CREATE_SHLIB+${SDATA2}}
${CREATE_SHLIB+${SBSS2}} ${CREATE_SHLIB+${SBSS2}}
@ -379,26 +379,26 @@ cat <<EOF
{ {
${RELOCATING+PROVIDE (__sbss_start = .);} ${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);} ${RELOCATING+PROVIDE (___sbss_start = .);}
*(.dynsbss) ${RELOCATING+*(.dynsbss)}
*(.sbss) *(.sbss)
${RELOCATING+*(.sbss.*)} ${RELOCATING+*(.sbss.*)}
${RELOCATING+*(.gnu.linkonce.sb.*)} ${RELOCATING+*(.gnu.linkonce.sb.*)}
*(.scommon) ${RELOCATING+*(.scommon)}
${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);} ${RELOCATING+PROVIDE (___sbss_end = .);}
} }
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} : .bss ${RELOCATING-0} :
{ {
*(.dynbss) ${RELOCATING+*(.dynbss)}
*(.bss) *(.bss)
${RELOCATING+*(.bss.*)} ${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)} ${RELOCATING+*(.gnu.linkonce.b.*)}
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */ .bss section disappears because there are no input sections. */
${RELOCATING+. = ALIGN(${ALIGNMENT});} . = ALIGN(${ALIGNMENT});}
} }
${RELOCATING+${OTHER_BSS_END_SYMBOLS}} ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+. = ALIGN(${ALIGNMENT});}

View File

@ -109,7 +109,7 @@ INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }" PLT=".plt ${RELOCATING-0} : { *(.plt) }"
if test -z "$GOT"; then if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; then if test -z "$SEPARATE_GOTPLT"; then
GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }" GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }"
else else
GOT=".got ${RELOCATING-0} : { *(.got) }" GOT=".got ${RELOCATING-0} : { *(.got) }"
GOTPLT="${RELOCATING+${DATA_SEGMENT_RELRO_GOTPLT_END}} GOTPLT="${RELOCATING+${DATA_SEGMENT_RELRO_GOTPLT_END}}
@ -126,9 +126,9 @@ if test -z "${NO_SMALL_DATA}"; then
${RELOCATING+PROVIDE (__sbss_start = .);} ${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);} ${RELOCATING+PROVIDE (___sbss_start = .);}
${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)} ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
*(.dynsbss) ${RELOCATING+*(.dynsbss)}
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*}) *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
*(.scommon) ${RELOCATING+*(.scommon)}
${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);} ${RELOCATING+PROVIDE (___sbss_end = .);}
}" }"
@ -331,7 +331,7 @@ cat <<EOF
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } .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 /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */ the same address within the page on the next page up. */
@ -341,7 +341,7 @@ cat <<EOF
/* Exception handling */ /* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } .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 */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
@ -391,13 +391,13 @@ cat <<EOF
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.bss ${RELOCATING-0} : .bss ${RELOCATING-0} :
{ {
*(.dynbss) ${RELOCATING+*(.dynbss)}
*(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */ .bss section disappears because there are no input sections. */
${RELOCATING+. = ALIGN(${ALIGNMENT});} . = ALIGN(${ALIGNMENT});}
} }
${OTHER_BSS_SECTIONS} ${OTHER_BSS_SECTIONS}
${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+. = ALIGN(${ALIGNMENT});}

View File

@ -139,9 +139,9 @@ cat <<EOF
*(.MMIX.reg_contents); *(.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. */ begins. They grow in opposite directions. */
PROVIDE (__Stack_start = 0x6000000000000000); PROVIDE (__Stack_start = 0x6000000000000000);}
/* Unfortunately, stabs are not mappable from ELF to MMO. /* Unfortunately, stabs are not mappable from ELF to MMO.
It can probably be fixed with some amount of work. */ It can probably be fixed with some amount of work. */

View File

@ -46,16 +46,16 @@ if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
fi fi
if test -z "$PLT"; then if test -z "$PLT"; then
IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }" 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}" ${IREL_IN_PLT-$IPLT}"
fi fi
test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT= test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=
if test -z "$GOT"; then if test -z "$GOT"; then
if test -z "$SEPARATE_GOTPLT"; 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 else
GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }" GOT=".got ${RELOCATING-0} : { *(.got)${RELOCATING+ *(.igot)} }"
GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }" GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt)${RELOCATING+ *(.igot.plt)} }"
fi fi
fi fi
REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }" REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }"
@ -80,27 +80,27 @@ if test -z "${NO_SMALL_DATA}"; then
SBSS=".sbss_b ${RELOCATING-0} : SBSS=".sbss_b ${RELOCATING-0} :
{ {
*(.sbss_b${RELOCATING+ .sbss_b.*}) *(.sbss_b${RELOCATING+ .sbss_b.*})
*(.scommon_b${RELOCATING+ .scommon_b.*}) ${RELOCATING+*(.scommon_b .scommon_b.*)}
${RELOCATING+. = ALIGN(2);} ${RELOCATING+. = ALIGN(2);}
} }
.sbss_h ${RELOCATING-0} : .sbss_h ${RELOCATING-0} :
{ {
*(.sbss_h${RELOCATING+ .sbss_h.*}) *(.sbss_h${RELOCATING+ .sbss_h.*})
*(.scommon_h${RELOCATING+ .scommon_h.*}) ${RELOCATING+*(.scommon_h .scommon_h.*)}
${RELOCATING+. = ALIGN(4);} ${RELOCATING+. = ALIGN(4);}
} }
.sbss_w ${RELOCATING-0} : .sbss_w ${RELOCATING-0} :
{ {
*(.sbss_w${RELOCATING+ .sbss_w.*}) *(.sbss_w${RELOCATING+ .sbss_w.*})
*(.scommon_w${RELOCATING+ .scommon_w.*}) ${RELOCATING+*(.scommon_w .scommon_w.*)
*(.dynsbss) *(.dynsbss)
*(.scommon) *(.scommon)
${RELOCATING+. = ALIGN(8);} . = ALIGN(8);}
} }
.sbss_d ${RELOCATING-0} : .sbss_d ${RELOCATING-0} :
{ {
*(.sbss_d${RELOCATING+ .sbss_d.*}) *(.sbss_d${RELOCATING+ .sbss_d.*})
*(.scommon_d${RELOCATING+ .scommon_d.*}) ${RELOCATING+*(.scommon_d .scommon_d.*)}
${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);} ${RELOCATING+PROVIDE (___sbss_end = .);}
}" }"
@ -488,11 +488,9 @@ cat <<EOF
${OTHER_READONLY_SECTIONS} ${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) } .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
.gcc_except_table.*) }
/* These sections are generated by the Sun/Oracle C++ compiler. */ /* These sections are generated by the Sun/Oracle C++ compiler. */
.exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges .exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges${RELOCATING+*}) }
.exception_ranges*) }
${TEXT_PLT+${PLT_NEXT_DATA+${PLT}}} ${TEXT_PLT+${PLT_NEXT_DATA+${PLT}}}
/* Adjust the address for the data segment. We want to adjust up to /* Adjust the address for the data segment. We want to adjust up to
@ -503,8 +501,8 @@ cat <<EOF
/* Exception handling */ /* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) } .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.*}) }
.exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } .exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges${RELOCATING+*}) }
/* Thread Local Storage sections */ /* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
@ -565,15 +563,15 @@ cat <<EOF
${BSS_PLT+${PLT}} ${BSS_PLT+${PLT}}
.${BSS_NAME} ${RELOCATING-0} : .${BSS_NAME} ${RELOCATING-0} :
{ {
*(.dyn${BSS_NAME}) ${RELOCATING+*(.dyn${BSS_NAME})}
*(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*}) *(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. .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. */ pad the .data section. */
${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);} . = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
} }
${OTHER_BSS_SECTIONS} ${OTHER_BSS_SECTIONS}
${LARGE_BSS_AFTER_BSS+${LARGE_BSS}} ${LARGE_BSS_AFTER_BSS+${LARGE_BSS}}

View File

@ -2,6 +2,9 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
EOF
test -n "${RELOCATING}" && cat <<EOF
MEMORY MEMORY
{ {
imem (x) : ORIGIN = $TEXT_ORIGIN, LENGTH = $TEXT_LENGTH imem (x) : ORIGIN = $TEXT_ORIGIN, LENGTH = $TEXT_LENGTH
@ -11,10 +14,13 @@ MEMORY
__HEAP_SIZE = DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : 32; __HEAP_SIZE = DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : 32;
__STACK_SIZE = DEFINED(__STACK_SIZE) ? __STACK_SIZE : 512; __STACK_SIZE = DEFINED(__STACK_SIZE) ? __STACK_SIZE : 512;
${RELOCATING+ PROVIDE (_stack_top = ORIGIN(dmem) + LENGTH(dmem)) ; } PROVIDE (_stack_top = ORIGIN(dmem) + LENGTH(dmem));
${RELOCATING+ENTRY (_start)} ENTRY (_start)
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
/* Read-only sections, merged into text segment: */ /* Read-only sections, merged into text segment: */
@ -122,11 +128,11 @@ SECTIONS
${CONSTRUCTING+ KEEP (*(.fini_array))} ${CONSTRUCTING+ KEEP (*(.fini_array))}
${CONSTRUCTING+ __fini_array_end = . ; } ${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 variable at the invalid NULL address, we introduce the .data.atzero
section. If CRT can make some use of it - great. Otherwise skip a 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. */ word. In all cases .data/.bss sections must start at non-zero. */
. += (. == 0 ? 4 : 0); . += (. == 0 ? 4 : 0);}
${RELOCATING+ PROVIDE (_data_start = .) ; } ${RELOCATING+ PROVIDE (_data_start = .) ; }
*(.data) *(.data)
@ -143,9 +149,8 @@ SECTIONS
.resource_table ${RELOCATING-0} : .resource_table ${RELOCATING-0} :
{ {
*(.resource_table)
KEEP (*(.resource_table)) KEEP (*(.resource_table))
} > dmem } ${RELOCATING+ > dmem}
.bss ${RELOCATING-0} : .bss ${RELOCATING-0} :
{ {
@ -154,7 +159,7 @@ SECTIONS
${RELOCATING+ *(.bss.*)} ${RELOCATING+ *(.bss.*)}
${RELOCATING+ *(.bss:*)} ${RELOCATING+ *(.bss:*)}
${RELOCATING+*(.gnu.linkonce.b*)} ${RELOCATING+*(.gnu.linkonce.b*)}
*(COMMON) ${RELOCATING+*(COMMON)}
${RELOCATING+ PROVIDE (_bss_end = .) ; } ${RELOCATING+ PROVIDE (_bss_end = .) ; }
} ${RELOCATING+ > dmem} } ${RELOCATING+ > dmem}
@ -166,9 +171,9 @@ SECTIONS
${RELOCATING+ PROVIDE (_noinit_end = .) ; } ${RELOCATING+ PROVIDE (_noinit_end = .) ; }
${RELOCATING+ PROVIDE (_heap_start = .) ; } ${RELOCATING+ PROVIDE (_heap_start = .) ; }
${RELOCATING+ . += __HEAP_SIZE ; } ${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 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+ . += __STACK_SIZE ; }
} ${RELOCATING+ > dmem} } ${RELOCATING+ > dmem}

View File

@ -12,7 +12,7 @@ TORS=".tors :
___dtors = . ; ___dtors = . ;
*(.dtors) *(.dtors)
___dtors_end = . ; ___dtors_end = . ;
} > ram" }${RELOCATING+ > ram}"
cat <<EOF cat <<EOF
/* Copyright (C) 2014-2018 Free Software Foundation, Inc. /* Copyright (C) 2014-2018 Free Software Foundation, Inc.
@ -24,11 +24,17 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH}) OUTPUT_ARCH(${ARCH})
EOF
test -n "${RELOCATING}" && cat <<EOF
MEMORY MEMORY
{ {
ram : o = 0x1000, l = 512k ram : o = 0x1000, l = 512k
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
.text : .text :

View File

@ -25,9 +25,9 @@ SECTIONS
.zdata ${ZDATA_START_ADDR} : .zdata ${ZDATA_START_ADDR} :
{ {
*(.zdata) *(.zdata)
*(.zbss) ${RELOCATING+*(.zbss)
*(reszdata) *(reszdata)
*(.zcommon) *(.zcommon)}
} }
/* This is the read only part of the zero data area. /* This is the read only part of the zero data area.
@ -39,8 +39,8 @@ SECTIONS
.rozdata ${ROZDATA_START_ADDR} : .rozdata ${ROZDATA_START_ADDR} :
{ {
*(.rozdata) *(.rozdata)
*(romzdata) ${RELOCATING+*(romzdata)
*(romzbss) *(romzbss)}
} }
/* Read-only sections, merged into text segment. */ /* Read-only sections, merged into text segment. */
@ -81,7 +81,7 @@ SECTIONS
/* .gnu.warning sections are handled specially by elf32.em. */ /* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning) *(.gnu.warning)
*(.gnu.linkonce.t*) ${RELOCATING+*(.gnu.linkonce.t*)}
} =0 } =0
${RELOCATING+_etext = .;} ${RELOCATING+_etext = .;}
@ -103,22 +103,22 @@ SECTIONS
} }
.fini : { KEEP (*(.fini)) } =0 .fini : { KEEP (*(.fini)) } =0
.rodata : { *(.rodata) ${RELOCATING+*(.rodata.*)} *(.gnu.linkonce.r*) } .rodata : { *(.rodata) ${RELOCATING+*(.rodata.*) *(.gnu.linkonce.r*)} }
.rodata1 : { *(.rodata1) } .rodata1 : { *(.rodata1) }
.data : .data :
{ {
*(.data) *(.data)
${RELOCATING+*(.data.*)} ${RELOCATING+*(.data.*)
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)}
CONSTRUCTORS ${CONSTRUCTING+CONSTRUCTORS}
} }
.data1 : { *(.data1) } .data1 : { *(.data1) }
.ctors : .ctors :
{ {
${CONSTRUCTING+___ctors = .;} ${CONSTRUCTING+___ctors = .;}
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*))) ${RELOCATING+KEEP (*(SORT(.ctors.*)))}
KEEP (*crtend(.ctors)) KEEP (*crtend(.ctors))
${CONSTRUCTING+___ctors_end = .;} ${CONSTRUCTING+___ctors_end = .;}
} }
@ -126,7 +126,7 @@ SECTIONS
{ {
${CONSTRUCTING+___dtors = .;} ${CONSTRUCTING+___dtors = .;}
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*))) ${RELOCATING+KEEP (*(SORT(.dtors.*)))}
KEEP (*crtend.o(.dtors)) KEEP (*crtend.o(.dtors))
${CONSTRUCTING+___dtors_end = .;} ${CONSTRUCTING+___dtors_end = .;}
} }
@ -137,17 +137,17 @@ SECTIONS
.gcc_except_table : { *(.gcc_except_table) } .gcc_except_table : { *(.gcc_except_table) }
.got : { *(.got.plt) *(.got) } .got : {${RELOCATING+ *(.got.plt)} *(.got) }
.dynamic : { *(.dynamic) } .dynamic : { *(.dynamic) }
.tdata ${TDATA_START_ADDR} : .tdata ${TDATA_START_ADDR} :
{ {
${RELOCATING+PROVIDE (__ep = .);} ${RELOCATING+PROVIDE (__ep = .);
*(.tbyte) *(.tbyte)
*(.tcommon_byte) *(.tcommon_byte)}
*(.tdata) *(.tdata)
*(.tbss) ${RELOCATING+*(.tbss)
*(.tcommon) *(.tcommon)}
} }
/* We want the small data sections together, so single-instruction offsets /* We want the small data sections together, so single-instruction offsets
@ -175,7 +175,7 @@ SECTIONS
{ {
${RELOCATING+__sbss_start = .;} ${RELOCATING+__sbss_start = .;}
*(.sbss) *(.sbss)
*(.scommon) ${RELOCATING+*(.scommon)}
} }
${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;} ${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;}
@ -185,9 +185,9 @@ SECTIONS
{ {
${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;} ${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;}
${RELOCATING+__real_bss_start = . ;} ${RELOCATING+__real_bss_start = . ;}
*(.dynbss) ${RELOCATING+*(.dynbss)}
*(.bss) *(.bss)
*(COMMON) ${RELOCATING+*(COMMON)}
} }
${RELOCATING+_end = . ;} ${RELOCATING+_end = . ;}

View File

@ -25,11 +25,11 @@ SECTIONS
.zdata ${ZDATA_START_ADDR} : .zdata ${ZDATA_START_ADDR} :
{ {
*(.zdata) *(.zdata)
*(.zdata23) ${RELOCATING+*(.zdata23)
*(.zbss) *(.zbss)
*(.zbss23) *(.zbss23)
*(reszdata) *(reszdata)
*(.zcommon) *(.zcommon)}
} }
/* This is the read only part of the zero data area. /* This is the read only part of the zero data area.
@ -41,10 +41,10 @@ SECTIONS
.rozdata ${ROZDATA_START_ADDR} : .rozdata ${ROZDATA_START_ADDR} :
{ {
*(.rozdata) *(.rozdata)
*(romzdata) ${RELOCATING+*(romzdata)
*(romzbss) *(romzbss)
*(.zconst) *(.zconst)
*(.zconst23) *(.zconst23)}
} }
/* Read-only sections, merged into text segment. */ /* Read-only sections, merged into text segment. */
@ -85,7 +85,7 @@ SECTIONS
/* .gnu.warning sections are handled specially by elf32.em. */ /* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning) *(.gnu.warning)
*(.gnu.linkonce.t*) ${RELOCATING+*(.gnu.linkonce.t*)}
} =0 } =0
${RELOCATING+_etext = .;} ${RELOCATING+_etext = .;}
@ -110,25 +110,25 @@ SECTIONS
.rodata : .rodata :
{ {
*(.rodata) *(.rodata)
${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.rodata.*)
*(.gnu.linkonce.r*) *(.gnu.linkonce.r*)
*(.const) *(.const)}
} }
.rodata1 : { *(.rodata1) } .rodata1 : { *(.rodata1) }
.data : .data :
{ {
*(.data) *(.data)
${RELOCATING+*(.data.*)} ${RELOCATING+*(.data.*)
*(.gnu.linkonce.d*) *(.gnu.linkonce.d*)}
CONSTRUCTORS ${CONSTRUCTING+CONSTRUCTORS}
} }
.data1 : { *(.data1) } .data1 : { *(.data1) }
.ctors : .ctors :
{ {
${CONSTRUCTING+___ctors = .;} ${CONSTRUCTING+___ctors = .;}
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*))) ${RELOCATING+KEEP (*(SORT(.ctors.*)))}
KEEP (*crtend(.ctors)) KEEP (*crtend(.ctors))
${CONSTRUCTING+___ctors_end = .;} ${CONSTRUCTING+___ctors_end = .;}
} }
@ -136,7 +136,7 @@ SECTIONS
{ {
${CONSTRUCTING+___dtors = .;} ${CONSTRUCTING+___dtors = .;}
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*))) ${RELOCATING+KEEP (*(SORT(.dtors.*)))}
KEEP (*crtend.o(.dtors)) KEEP (*crtend.o(.dtors))
${CONSTRUCTING+___dtors_end = .;} ${CONSTRUCTING+___dtors_end = .;}
} }
@ -147,23 +147,23 @@ SECTIONS
.gcc_except_table : { *(.gcc_except_table) } .gcc_except_table : { *(.gcc_except_table) }
.got : { *(.got.plt) *(.got) } .got : {${RELOCATING+ *(.got.plt)} *(.got) }
.dynamic : { *(.dynamic) } .dynamic : { *(.dynamic) }
.tdata ${TDATA_START_ADDR} : .tdata ${TDATA_START_ADDR} :
{ {
${RELOCATING+PROVIDE (__ep = .);} ${RELOCATING+PROVIDE (__ep = .);
*(.edata) *(.edata)
*(.edata23) *(.edata23)
*(.tbyte) *(.tbyte)
*(.tcommon_byte) *(.tcommon_byte)}
*(.tdata) *(.tdata)
*(.tdata*) ${RELOCATING+*(.tdata*)
*(.ebss) *(.ebss)
*(.ebss23) *(.ebss23)
*(.tbss) *(.tbss)
*(.tbss*) *(.tbss*)
*(.tcommon) *(.tcommon)}
} }
/* We want the small data sections together, so single-instruction offsets /* We want the small data sections together, so single-instruction offsets
@ -174,15 +174,15 @@ SECTIONS
{ {
${RELOCATING+PROVIDE (__gp = . + 0x8000);} ${RELOCATING+PROVIDE (__gp = . + 0x8000);}
*(.sdata) *(.sdata)
*(.sdata23) ${RELOCATING+*(.sdata23)}
} }
/* See comment about .rozdata. */ /* See comment about .rozdata. */
.rosdata ${ROSDATA_START_ADDR} : .rosdata ${ROSDATA_START_ADDR} :
{ {
*(.rosdata) *(.rosdata)
*(.sconst) ${RELOCATING+*(.sconst)
*(.sconst23) *(.sconst23)}
} }
/* We place the .sbss data section AFTER the .rosdata section, so that /* We place the .sbss data section AFTER the .rosdata section, so that
@ -194,8 +194,8 @@ SECTIONS
{ {
${RELOCATING+__sbss_start = .;} ${RELOCATING+__sbss_start = .;}
*(.sbss) *(.sbss)
*(.sbss23) ${RELOCATING+*(.sbss23)
*(.scommon) *(.scommon)}
} }
${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;} ${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;}
@ -205,9 +205,9 @@ SECTIONS
{ {
${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;} ${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;}
${RELOCATING+__real_bss_start = . ;} ${RELOCATING+__real_bss_start = . ;}
*(.dynbss) ${RELOCATING+*(.dynbss)}
*(.bss) *(.bss)
*(COMMON) ${RELOCATING+*(COMMON)}
} }
${RELOCATING+_end = . ;} ${RELOCATING+_end = . ;}

View File

@ -35,14 +35,15 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}") OUTPUT_FORMAT("${OUTPUT_FORMAT}")
ENTRY(${ENTRY}) ENTRY(${ENTRY})
EOF
test -n "${RELOCATING}" && cat <<EOF
/* Start and end of main stack. Assumes 256K of RAM. */ /* Start and end of main stack. Assumes 256K of RAM. */
${RELOCATING+ _estack = 0xe0040000 - 4;} _estack = 0xe0040000 - 4;
${RELOCATING+ _sstack = 0xe0040000 - 64K;} _sstack = 0xe0040000 - 64K;
/* End of heap. */ /* End of heap. */
${RELOCATING+ _eheap = _sstack - 4;} _eheap = _sstack - 4;
MEMORY MEMORY
{ {
@ -53,12 +54,14 @@ MEMORY
saferam : ORIGIN = 0xf0000000, LENGTH = 0x10000000 saferam : ORIGIN = 0xf0000000, LENGTH = 0x10000000
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
.init ${RELOCATING-0} : { .init ${RELOCATING-0} : {
KEEP (*(.init)) KEEP (*(.init))
KEEP (*(.fini)) ${RELOCATING+KEEP (*(.fini))}
${RELOCATING+ _einit = .;} ${RELOCATING+ _einit = .;}
} ${RELOCATING+ > init} } ${RELOCATING+ > init}
@ -91,7 +94,7 @@ SECTIONS
end of ctors marker and it must be last. */ end of ctors marker and it must be last. */
KEEP (*(EXCLUDE_FILE (*crtend*.o) .ctors)) KEEP (*(EXCLUDE_FILE (*crtend*.o) .ctors))
KEEP (*(SORT(.ctors.*))) ${RELOCATING+KEEP (*(SORT(.ctors.*)))}
KEEP (*(.ctors)) KEEP (*(.ctors))
${CONSTRUCTING+ __CTOR_END__ = .;} ${CONSTRUCTING+ __CTOR_END__ = .;}
} ${RELOCATING+ > rom} } ${RELOCATING+ > rom}
@ -100,14 +103,14 @@ SECTIONS
${CONSTRUCTING+ __DTOR_LIST__ = .;} ${CONSTRUCTING+ __DTOR_LIST__ = .;}
KEEP (*crtbegin*.o(.dtors)) KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o) .dtors)) KEEP (*(EXCLUDE_FILE (*crtend*.o) .dtors))
KEEP (*(SORT(.dtors.*))) ${RELOCATING+KEEP (*(SORT(.dtors.*)))}
KEEP (*(.dtors)) KEEP (*(.dtors))
${CONSTRUCTING+ __DTOR_END__ = .;} ${CONSTRUCTING+ __DTOR_END__ = .;}
} ${RELOCATING+ > rom} } ${RELOCATING+ > rom}
.rodata ${RELOCATING-0} : { .rodata ${RELOCATING-0} : {
${RELOCATING+ . = ALIGN(4);} ${RELOCATING+ . = ALIGN(4);}
${RELOCATING+ _srdata = .;} ${RELOCATING+ _srdata = .;}
*(.rdata) ${RELOCATING+*(.rdata)}
*(.rodata) *(.rodata)
${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.rodata.*)}
${RELOCATING+*(.gnu.linkonce.r.*)} ${RELOCATING+*(.gnu.linkonce.r.*)}
@ -140,7 +143,7 @@ SECTIONS
*(.bss) *(.bss)
${RELOCATING+*(.bss.*)} ${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)} ${RELOCATING+*(.gnu.linkonce.b.*)}
*(COMMON) ${RELOCATING+*(COMMON)}
${RELOCATING+ . = ALIGN(4);} ${RELOCATING+ . = ALIGN(4);}
${RELOCATING+ __bss_end = .;} ${RELOCATING+ __bss_end = .;}
${RELOCATING+ _sheap = .;} ${RELOCATING+ _sheap = .;}
@ -168,7 +171,7 @@ EOF
cat <<EOF cat <<EOF
} }
${RELOCATING+
/* Provide a default address for the simulated file-I/O device. */ /* Provide a default address for the simulated file-I/O device. */
PROVIDE (_sim_fileio_register = 0x2fff0000); PROVIDE (_sim_fileio_register = 0x2fff0000);
@ -176,6 +179,6 @@ PROVIDE (_sim_fileio_register = 0x2fff0000);
PROVIDE (_sim_cmdline_header = 0x2ffe0000); PROVIDE (_sim_cmdline_header = 0x2ffe0000);
/* Provide a default address for the simulated 1 MHz clock. */ /* Provide a default address for the simulated 1 MHz clock. */
PROVIDE (_sim_clock = 0x20002100); PROVIDE (_sim_clock = 0x20002100);}
EOF EOF

View File

@ -107,15 +107,14 @@ cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}") "${LITTLE_OUTPUT_FORMAT}")
OUTPUT_ARCH(${OUTPUT_ARCH}) OUTPUT_ARCH(${OUTPUT_ARCH})
${RELOCATING+ENTRY(${ENTRY})} EOF
${RELOCATING+${LIB_SEARCH_DIRS}} test -n "${RELOCATING}" && cat <<EOF
${RELOCATING+${EXECUTABLE_SYMBOLS}} ENTRY(${ENTRY})
${RELOCATING+${INPUT_FILES}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables ${LIB_SEARCH_DIRS}
if gld -r is used and the intermediate file has sections starting ${EXECUTABLE_SYMBOLS}
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld ${INPUT_FILES}
bug. But for now assigning the zero vmas works. */}
/* There are two memory regions we care about, one from 0 through 0x7F00 /* There are two memory regions we care about, one from 0 through 0x7F00
that is RAM and one from 0x8000 up which is ROM. */ that is RAM and one from 0x8000 up which is ROM. */
@ -124,7 +123,9 @@ MEMORY
RAM (w) : ORIGIN = 0, LENGTH = 0x7F00 RAM (w) : ORIGIN = 0, LENGTH = 0x7F00
ROM (!w) : ORIGIN = 0x8000, LENGTH = 0xFF8000 ROM (!w) : ORIGIN = 0x8000, LENGTH = 0xFF8000
} }
EOF
cat <<EOF
SECTIONS SECTIONS
{ {
.data ${RELOCATING-0} : .data ${RELOCATING-0} :
@ -136,7 +137,7 @@ SECTIONS
${RELOCATING+*(.data.*)} ${RELOCATING+*(.data.*)}
${RELOCATING+*(.gnu.linkonce.d.*)} ${RELOCATING+*(.gnu.linkonce.d.*)}
${CONSTRUCTING+SORT(CONSTRUCTORS)} ${CONSTRUCTING+SORT(CONSTRUCTORS)}
} > RAM }${RELOCATING+ > RAM}
${RELOCATING+${OTHER_READWRITE_SECTIONS}} ${RELOCATING+${OTHER_READWRITE_SECTIONS}}
${RELOCATING+${OTHER_GOT_SYMBOLS}} ${RELOCATING+${OTHER_GOT_SYMBOLS}}
${RELOCATING+${OTHER_GOT_SECTIONS}} ${RELOCATING+${OTHER_GOT_SECTIONS}}
@ -146,16 +147,16 @@ SECTIONS
${RELOCATING+${OTHER_BSS_SYMBOLS}} ${RELOCATING+${OTHER_BSS_SYMBOLS}}
.bss ${RELOCATING-0} : .bss ${RELOCATING-0} :
{ {
*(.dynbss) ${RELOCATING+*(.dynbss)}
*(.bss) *(.bss)
${RELOCATING+*(.bss.*)} ${RELOCATING+*(.bss.*)}
${RELOCATING+*(.gnu.linkonce.b.*)} ${RELOCATING+*(.gnu.linkonce.b.*)}
*(COMMON) ${RELOCATING+*(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */ .bss section disappears because there are no input sections. */
${RELOCATING+. = ALIGN(${ALIGNMENT});} . = ALIGN(${ALIGNMENT});}
} > RAM }${RELOCATING+ > RAM}
${RELOCATING+${OTHER_BSS_END_SYMBOLS}} ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+. = ALIGN(${ALIGNMENT});}
${RELOCATING+${OTHER_END_SYMBOLS}} ${RELOCATING+${OTHER_END_SYMBOLS}}
@ -164,15 +165,15 @@ SECTIONS
${RELOCATING+PROVIDE (end = .);} ${RELOCATING+PROVIDE (end = .);}
/* Read-only sections in ROM. */ /* 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+${CTOR}}
${RELOCATING+${DTOR}} ${RELOCATING+${DTOR}}
.jcr : { KEEP (*(.jcr)) } ${RELOCATING+> ROM} .jcr : { KEEP (*(.jcr)) }${RELOCATING+ > ROM}
.eh_frame : { KEEP (*(.eh_frame)) } ${RELOCATING+> ROM} .eh_frame : { KEEP (*(.eh_frame)) }${RELOCATING+ > ROM}
.gcc_except_table : { *(.gcc_except_table) *(.gcc_except_table.*) } ${RELOCATING+> ROM} .gcc_except_table : { *(.gcc_except_table)${RELOCATING+ *(.gcc_except_table.*)} }${RELOCATING+ > ROM}
.plt : { *(.plt) } ${RELOCATING+> ROM} .plt : { *(.plt) }${RELOCATING+ > ROM}
.text ${RELOCATING-0} : .text ${RELOCATING-0} :
{ {
@ -184,19 +185,19 @@ SECTIONS
*(.gnu.warning) *(.gnu.warning)
${RELOCATING+*(.gnu.linkonce.t.*)} ${RELOCATING+*(.gnu.linkonce.t.*)}
${RELOCATING+${OTHER_TEXT_SECTIONS}} ${RELOCATING+${OTHER_TEXT_SECTIONS}}
} ${RELOCATING+> ROM =${NOP-0}} }${RELOCATING+ > ROM =${NOP-0}}
.init ${RELOCATING-0} : .init ${RELOCATING-0} :
{ {
${RELOCATING+${INIT_START}} ${RELOCATING+${INIT_START}}
KEEP (*(.init)) KEEP (*(.init))
${RELOCATING+${INIT_END}} ${RELOCATING+${INIT_END}}
} ${RELOCATING+> ROM =${NOP-0}} }${RELOCATING+ > ROM =${NOP-0}}
.fini ${RELOCATING-0} : .fini ${RELOCATING-0} :
{ {
${RELOCATING+${FINI_START}} ${RELOCATING+${FINI_START}}
KEEP (*(.fini)) KEEP (*(.fini))
${RELOCATING+${FINI_END}} ${RELOCATING+${FINI_END}}
} ${RELOCATING+> ROM =${NOP-0}} }${RELOCATING+ > ROM =${NOP-0}}
${RELOCATING+PROVIDE (__etext = .);} ${RELOCATING+PROVIDE (__etext = .);}
${RELOCATING+PROVIDE (_etext = .);} ${RELOCATING+PROVIDE (_etext = .);}
${RELOCATING+PROVIDE (etext = .);} ${RELOCATING+PROVIDE (etext = .);}

View File

@ -1,10 +1,8 @@
#source: ../../../binutils/testsuite/binutils-all/group.s #source: ../../../binutils/testsuite/binutils-all/group.s
#ld: -r #ld: -r
#readelf: -Sg --wide #readelf: -Sg --wide
#xfail: cr16-*-* crx-*-* xstormy*-*-* # xstormy uses a non-standard script, putting .data before .text.
# cr16 and crx use non-standard scripts with memory regions, which don't play #xfail: xstormy*-*-*
# well with unique group sections under ld -r.
# xstormy also uses a non-standard script, putting .data before .text.
#... #...
\[[ 0-9]+\] \.group[ \t]+GROUP[ \t]+.* \[[ 0-9]+\] \.group[ \t]+GROUP[ \t]+.*

View File

@ -1,10 +1,8 @@
#source: ../../../binutils/testsuite/binutils-all/group-2.s #source: ../../../binutils/testsuite/binutils-all/group-2.s
#ld: -r #ld: -r
#readelf: -Sg --wide #readelf: -Sg --wide
#xfail: cr16-*-* crx-*-* xstormy*-*-* # xstormy uses a non-standard script, putting .data before .text.
# cr16 and crx use non-standard scripts with memory regions, which don't play #xfail: xstormy*-*-*
# well with unique group sections under ld -r.
# xstormy also uses a non-standard script, putting .data before .text.
#... #...
\[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.* \[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.*

View File

@ -1,10 +1,8 @@
#source: ../../../binutils/testsuite/binutils-all/group-3.s #source: ../../../binutils/testsuite/binutils-all/group-3.s
#ld: -r #ld: -r
#readelf: -Sg --wide #readelf: -Sg --wide
#xfail: cr16-*-* crx-*-* xstormy*-*-* # xstormy uses a non-standard script, putting .data before .text.
# cr16 and crx use non-standard scripts with memory regions, which don't play #xfail: xstormy*-*-*
# well with unique group sections under ld -r.
# xstormy also uses a non-standard script, putting .data before .text.
#... #...
\[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.* \[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.*

View File

@ -1,10 +1,8 @@
#source: ../../../binutils/testsuite/binutils-all/group-4.s #source: ../../../binutils/testsuite/binutils-all/group-4.s
#ld: -r #ld: -r
#readelf: -Sg --wide #readelf: -Sg --wide
#xfail: cr16-*-* crx-*-* xstormy*-*-* # xstormy uses a non-standard script, putting .data before .text.
# cr16 and crx use non-standard scripts with memory regions, which don't play #xfail: xstormy*-*-*
# well with unique group sections under ld -r.
# xstormy also uses a non-standard script, putting .data before .text.
#... #...
\[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.* \[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.*

View File

@ -4,9 +4,6 @@
#source: ../../../binutils/testsuite/binutils-all/group-4.s #source: ../../../binutils/testsuite/binutils-all/group-4.s
#ld: -r #ld: -r
#readelf: -g --wide #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: COMDAT group section \[[ 0-9]+\] `\.group' \[foo_group\] contains . sections:

View File

@ -1,11 +1,9 @@
#source: group8.s #source: group8.s
#ld: -r --gc-sections --entry foo #ld: -r --gc-sections --entry foo
#readelf: -g --wide #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 # 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 #xfail: d30v-*-* dlx-*-* hppa64-*-*
# well with unique group sections under ld -r. #xfail: mep-*-* mn10200-*-* pj*-*-* pru-*-* xgate-*-*
COMDAT group section \[[ 0-9]+\] `.group' \[foo\] contains . sections: COMDAT group section \[[ 0-9]+\] `.group' \[foo\] contains . sections:
\[Index\] Name \[Index\] Name

View File

@ -1,11 +1,9 @@
#source: group8.s #source: group8.s
#ld: -r --gc-sections --entry bar #ld: -r --gc-sections --entry bar
#readelf: -g --wide #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 # 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 #xfail: d30v-*-* dlx-*-* hppa64-*-* mep-*-* mn10200-*-*
# well with unique group sections under ld -r. #xfail: pj*-*-* pru-*-* xgate-*-*
COMDAT group section \[[ 0-9]+\] `.group' \[bar\] contains . sections: COMDAT group section \[[ 0-9]+\] `.group' \[bar\] contains . sections:
\[Index\] Name \[Index\] Name

View File

@ -1,11 +1,9 @@
#source: group9.s #source: group9.s
#ld: -r --gc-sections --entry foo #ld: -r --gc-sections --entry foo
#readelf: -g --wide #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 # 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 #xfail: d30v-*-* dlx-*-* hppa64-*-* mep-*-* mn10200-*-*
# well with unique group sections under ld -r. #xfail: pj*-*-* pru-*-* xgate-*-*
COMDAT group section \[[ 0-9]+\] `.group' \[foo\] contains . sections: COMDAT group section \[[ 0-9]+\] `.group' \[foo\] contains . sections:
\[Index\] Name \[Index\] Name

View File

@ -1,11 +1,9 @@
#source: group9.s #source: group9.s
#ld: -r --gc-sections --entry bar #ld: -r --gc-sections --entry bar
#readelf: -g --wide #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 # 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 #xfail: d30v-*-* dlx-*-* hppa64-*-* mep-*-* mn10200-*-*
# well with unique group sections under ld -r. #xfail: pj*-*-* pru-*-* xgate-*-*
COMDAT group section \[[ 0-9]+\] `.group' \[foo\] contains . sections: COMDAT group section \[[ 0-9]+\] `.group' \[foo\] contains . sections:
\[Index\] Name \[Index\] Name

View File

@ -1,10 +1,6 @@
#source: init-fini-arrays.s #source: init-fini-arrays.s
#ld: -r #ld: -r
#readelf: -S --wide #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?.* \[[ 0-9]+\] \.init_array\.01000[ \t]+INIT_ARRAY[ \t0-9a-f]+WA?.*

View File

@ -2,10 +2,8 @@
#source: pr17550-2.s #source: pr17550-2.s
#ld: -r #ld: -r
#readelf: -s --wide #readelf: -s --wide
#xfail: alpha-*-* cr16-*-* crx-*-*
# Disabled on alpha because alpha has a different .set directive. # Disabled on alpha because alpha has a different .set directive.
# cr16 and crx use non-standard scripts with memory regions, which don't #xfail: alpha-*-*
# play well with comdat group sections under ld -r.
#failif #failif
#... #...

View File

@ -2,10 +2,8 @@
#source: pr17550-1.s #source: pr17550-1.s
#ld: -r #ld: -r
#readelf: -s --wide #readelf: -s --wide
#xfail: alpha-*-* cr16-*-* crx-*-*
# Disabled on alpha because alpha has a different .set directive. # Disabled on alpha because alpha has a different .set directive.
# cr16 and crx use non-standard scripts with memory regions, which don't #xfail: alpha-*-*
# play well with comdat group sections under ld -r.
#failif #failif
#... #...

View File

@ -2,11 +2,9 @@
#source: pr17550-4.s #source: pr17550-4.s
#ld: -r #ld: -r
#readelf: -s --wide #readelf: -s --wide
#xfail: alpha-*-* cr16-*-* crx-*-* d30v-*-* dlx-*-* pj*-*-* xgate-*-*
# Disabled on alpha because alpha has a different .set directive. # Disabled on alpha because alpha has a different .set directive.
# cr16 and crx use non-standard scripts with memory regions, which don't # Generic linker targets don't support comdat group sections.
# play well with comdat group sections under ld -r. Generic linker #xfail: alpha-*-* d30v-*-* dlx-*-* pj*-*-* xgate-*-*
# targets don't support comdat group sections.
#... #...
+[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +UND y +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +UND y

View File

@ -1,12 +1,9 @@
#ld: -r --gc-sections -u foo #ld: -r --gc-sections -u foo
#readelf: -S --wide #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 # generic linker targets don't support --gc-sections, nor do a bunch of
# others. # others.
# cr16 and crx use non-standard scripts with memory regions, which don't #xfail: d30v-*-* dlx-*-* hppa64-*-*
# play well with unique group sections under ld -r. #xfail: mep-*-* mn10200-*-* pj*-*-* pru-*-* xgate-*-*
#... #...
\[[ 0-9]+\] \.preinit_array\.01000[ \t]+PREINIT_ARRAY[ \t0-9a-f]+WA?.* \[[ 0-9]+\] \.preinit_array\.01000[ \t]+PREINIT_ARRAY[ \t0-9a-f]+WA?.*