diff --git a/ld/ChangeLog b/ld/ChangeLog index b772dcdd5c..4dfd2e8241 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,22 @@ +2018-10-29 Alan Modra + + * Makefile.am (ei386beos.c, ei386go32.c): Correct dependencies. + * Makefile.in: Regenerate. + * scripttempl/elf.sc (.note.gnu.build-id, .eh_frame_hdr): Set + address with ${RELOCATING-0}. + * scripttempl/arclinux.sc: Likewise. + * scripttempl/armbpabi.sc: Likewise. + * scripttempl/avr.sc: Likewise. + * scripttempl/elf64hppa.sc: Likewise. + * scripttempl/elf_chaos.sc: Likewise. + * scripttempl/elfarc.sc: Likewise. + * scripttempl/elfxtensa.sc: Likewise. + * scripttempl/mep.sc: Likewise. + * scripttempl/nds32elf.sc: Likewise. + * scripttempl/pru.sc: Likewise. + * scripttempl/elf32msp430.sc: Likewise, and for other sections. + * scripttempl/epiphany_4x4.sc: Similarly. + 2018-10-26 Christoph Conrads * ld.texi (--gc-sections): Update. diff --git a/ld/Makefile.am b/ld/Makefile.am index 98ba096268..7b4b49e762 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -1382,13 +1382,15 @@ ehppaobsd.c: $(srcdir)/emulparams/hppaobsd.sh \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ei386beos.c: $(srcdir)/emulparams/i386beos.sh \ - $(srcdir)/emultempl/beos.em $(srcdir)/scripttempl/i386beos.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/beos.em $(srcdir)/scripttempl/i386beos.sc \ + $(srcdir)/scripttempl/DWARF.sc ${GEN_DEPENDS} ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ei386go32.c: $(srcdir)/emulparams/i386go32.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc \ + $(srcdir)/scripttempl/DWARF.sc ${GEN_DEPENDS} ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} diff --git a/ld/Makefile.in b/ld/Makefile.in index e2fc674153..9137cf3bd7 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -2986,13 +2986,15 @@ ehppaobsd.c: $(srcdir)/emulparams/hppaobsd.sh \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ei386beos.c: $(srcdir)/emulparams/i386beos.sh \ - $(srcdir)/emultempl/beos.em $(srcdir)/scripttempl/i386beos.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/beos.em $(srcdir)/scripttempl/i386beos.sc \ + $(srcdir)/scripttempl/DWARF.sc ${GEN_DEPENDS} ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ei386go32.c: $(srcdir)/emulparams/i386go32.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS} + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc \ + $(srcdir)/scripttempl/DWARF.sc ${GEN_DEPENDS} ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} diff --git a/ld/scripttempl/arclinux.sc b/ld/scripttempl/arclinux.sc index 931d7a54ab..2975864100 100644 --- a/ld/scripttempl/arclinux.sc +++ b/ld/scripttempl/arclinux.sc @@ -358,7 +358,7 @@ emit_early_ro() { cat < text} - .rodata : + .rodata ${RELOCATING-0} : { ${RELOCATING+. = ALIGN(2); *(.lower.rodata.* .lower.rodata) @@ -239,7 +239,7 @@ SECTIONS KEEP (*(.dtors))} } ${RELOCATING+ > text} - .vectors ${RELOCATING-0}: + .vectors ${RELOCATING-0} : { ${RELOCATING+ PROVIDE (__vectors_start = .) ; } *(.vectors${RELOCATING+*}) @@ -277,7 +277,7 @@ SECTIONS ${RELOCATING+__romdatastart = LOADADDR(.data); __romdatacopysize = SIZEOF(.data);} - .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : + .bss ${RELOCATING-0}${RELOCATING+SIZEOF(.data) + ADDR(.data)} : { ${RELOCATING+. = ALIGN(2);} ${RELOCATING+ PROVIDE (__bss_start = .); } @@ -291,14 +291,14 @@ SECTIONS } ${RELOCATING+ > data} ${RELOCATING+ PROVIDE (__bsssize = SIZEOF(.bss)); } - .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} : + .noinit ${RELOCATING-0}${RELOCATING+SIZEOF(.bss) + ADDR(.bss)} : { ${RELOCATING+ PROVIDE (__noinit_start = .) ; } *(.noinit) ${RELOCATING+ PROVIDE (__noinit_end = .) ; } } ${RELOCATING+ > data} - .persistent ${RELOCATING+ SIZEOF(.noinit) + ADDR(.noinit)} : + .persistent ${RELOCATING-0}${RELOCATING+SIZEOF(.noinit) + ADDR(.noinit)} : { ${RELOCATING+ PROVIDE (__persistent_start = .) ; } *(.persistent) diff --git a/ld/scripttempl/elf64hppa.sc b/ld/scripttempl/elf64hppa.sc index 1bed6743c5..5496f3be7a 100644 --- a/ld/scripttempl/elf64hppa.sc +++ b/ld/scripttempl/elf64hppa.sc @@ -299,7 +299,7 @@ SECTIONS ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR} + SIZEOF_HEADERS;}} ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR} + SIZEOF_HEADERS;}} ${INITIAL_READONLY_SECTIONS} - .note.gnu.build-id : { *(.note.gnu.build-id) } + .note.gnu.build-id ${RELOCATING-0}: { *(.note.gnu.build-id) } EOF test -n "${RELOCATING+0}" || unset NON_ALLOC_DYN @@ -431,7 +431,7 @@ cat < INTERNAL_RAM} */ =${NOP-0} - .text ${RELOCATING+ADDR(.fini)+SIZEOF(.fini)} ${RELOCATING-0} : + .text ${RELOCATING-0}${RELOCATING+ADDR(.fini)+SIZEOF(.fini)} : { ${RELOCATING+${TEXT_START_SYMBOLS}} *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*}) @@ -503,7 +503,7 @@ cat < dmem} /* Global data not cleared after reset. */ - .noinit ${RELOCATING-0}: + .noinit ${RELOCATING-0} : { ${RELOCATING+ PROVIDE (_noinit_start = .) ; } *(.noinit) @@ -185,7 +185,7 @@ SECTIONS .stab.index 0 : { *(.stab.index) } .stab.indexstr 0 : { *(.stab.indexstr) } .comment 0 : { *(.comment) } - .note.gnu.build-id : { *(.note.gnu.build-id) } + .note.gnu.build-id ${RELOCATING-0} : { *(.note.gnu.build-id) } EOF . $srcdir/scripttempl/DWARF.sc