diff options
author | Alan Modra <amodra@gmail.com> | 2019-12-05 16:40:02 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-12-05 17:35:13 +1030 |
commit | 6e9ed99753f0730e85bd45eabb63f499e4d0eca3 (patch) | |
tree | 4e9354f5ea4fe2d9485024ffebe0b980b65e6232 /ld/emulparams | |
parent | 1769380a11463b907263ef5443de5d14559f2095 (diff) | |
download | binutils-gdb-6e9ed99753f0730e85bd45eabb63f499e4d0eca3.tar.gz |
PR25243, static linking with exceptions and iostream is broken on ARM
PR 25243
* emulparams/armelf.sh (OTHER_READONLY_SECTIONS): Move definition
of __exidx_start and __exidx_end into ARM.exidx.
* emulparams/armelf_linux_eabi.sh (OTHER_READONLY_SECTIONS): Likewise.
* emulparams/armsymbian.sh (OTHER_READONLY_SECTIONS): Similarly.
* emulparams/elf32_tic6x_le.sh (OTHER_READONLY_SECTIONS): Similarly.
* emulparams/armelf_fuchsia.sh: Source armelf_linux_eabi.sh,
just redefining TEXT_START_ADDR.
* emulparams/armelf_linux_fdpiceabi.sh: Source armelf_linux_eabi.sh,
adding to OTHER_READONLY_SECTIONS.
Diffstat (limited to 'ld/emulparams')
-rw-r--r-- | ld/emulparams/armelf.sh | 9 | ||||
-rw-r--r-- | ld/emulparams/armelf_fuchsia.sh | 31 | ||||
-rw-r--r-- | ld/emulparams/armelf_linux_eabi.sh | 10 | ||||
-rw-r--r-- | ld/emulparams/armelf_linux_fdpiceabi.sh | 9 | ||||
-rw-r--r-- | ld/emulparams/armsymbian.sh | 13 | ||||
-rw-r--r-- | ld/emulparams/elf32_tic6x_le.sh | 9 |
6 files changed, 29 insertions, 52 deletions
diff --git a/ld/emulparams/armelf.sh b/ld/emulparams/armelf.sh index 0e3147c1f24..24ca8ed59d0 100644 --- a/ld/emulparams/armelf.sh +++ b/ld/emulparams/armelf.sh @@ -26,9 +26,12 @@ OTHER_SECTIONS=' ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' OTHER_READONLY_SECTIONS=" .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) } - ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); } - .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } - ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }" + .ARM.exidx ${RELOCATING-0} : + { + ${RELOCATING+PROVIDE_HIDDEN (__exidx_start = .);} + *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) + ${RELOCATING+PROVIDE_HIDDEN (__exidx_end = .);} + }" DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__data_start = .${CREATE_SHLIB+)};" diff --git a/ld/emulparams/armelf_fuchsia.sh b/ld/emulparams/armelf_fuchsia.sh index 823ddf503cf..f67ebd79aca 100644 --- a/ld/emulparams/armelf_fuchsia.sh +++ b/ld/emulparams/armelf_fuchsia.sh @@ -1,32 +1,3 @@ -ARCH=arm -SCRIPT_NAME=elf -OUTPUT_FORMAT="elf32-littlearm" -BIG_OUTPUT_FORMAT="elf32-bigarm" -LITTLE_OUTPUT_FORMAT="elf32-littlearm" -MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" -COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" -TEMPLATE_NAME=elf -EXTRA_EM_FILE=armelf -GENERATE_SHLIB_SCRIPT=yes -GENERATE_PIE_SCRIPT=yes - -DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; -OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)' -OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" -OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" -OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" -OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' +source_sh ${srcdir}/emulparams/armelf_linux_eabi.sh TEXT_START_ADDR=0x00001000 -TARGET2_TYPE=got-rel - -# ARM does not support .s* sections. -NO_SMALL_DATA=yes - -# Use the ARM ABI-compliant exception-handling sections. -OTHER_READONLY_SECTIONS=" - .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) } - ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); } - .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } - ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }" - diff --git a/ld/emulparams/armelf_linux_eabi.sh b/ld/emulparams/armelf_linux_eabi.sh index e1b6a114fc0..312d0067765 100644 --- a/ld/emulparams/armelf_linux_eabi.sh +++ b/ld/emulparams/armelf_linux_eabi.sh @@ -3,7 +3,9 @@ source_sh ${srcdir}/emulparams/armelf_linux.sh # Use the ARM ABI-compliant exception-handling sections. OTHER_READONLY_SECTIONS=" .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) } - ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); } - .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } - ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }" - + .ARM.exidx ${RELOCATING-0} : + { + ${RELOCATING+PROVIDE_HIDDEN (__exidx_start = .);} + *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) + ${RELOCATING+PROVIDE_HIDDEN (__exidx_end = .);} + }" diff --git a/ld/emulparams/armelf_linux_fdpiceabi.sh b/ld/emulparams/armelf_linux_fdpiceabi.sh index 97d41f88eff..84e452bfc6c 100644 --- a/ld/emulparams/armelf_linux_fdpiceabi.sh +++ b/ld/emulparams/armelf_linux_fdpiceabi.sh @@ -1,15 +1,10 @@ -source_sh ${srcdir}/emulparams/armelf_linux.sh +source_sh ${srcdir}/emulparams/armelf_linux_eabi.sh OUTPUT_FORMAT="elf32-littlearm-fdpic" BIG_OUTPUT_FORMAT="elf32-bigarm-fdpic" LITTLE_OUTPUT_FORMAT="elf32-littlearm-fdpic" -# Use the ARM ABI-compliant exception-handling sections. -OTHER_READONLY_SECTIONS=" - .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) } - ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); } - .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } - ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); } +OTHER_READONLY_SECTIONS="${OTHER_READONLY_SECTIONS} .rofixup : { ${RELOCATING+__ROFIXUP_LIST__ = .;} *(.rofixup) diff --git a/ld/emulparams/armsymbian.sh b/ld/emulparams/armsymbian.sh index 1959685f9b4..f6431658199 100644 --- a/ld/emulparams/armsymbian.sh +++ b/ld/emulparams/armsymbian.sh @@ -13,10 +13,13 @@ EMBEDDED=yes # .ARM.exidx$${Base,Limit} symbols. OTHER_READONLY_SECTIONS=" .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) } - ${RELOCATING+ PROVIDE_HIDDEN (.ARM.exidx\$\$Base = .); } - ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); } - .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } - ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); } - ${RELOCATING+ PROVIDE_HIDDEN (.ARM.exidx\$\$Limit = .); }" + .ARM.exidx ${RELOCATING-0} : + { + ${RELOCATING+PROVIDE_HIDDEN (.ARM.exidx\$\$Base = .);} + ${RELOCATING+PROVIDE_HIDDEN (__exidx_start = .);} + *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) + ${RELOCATING+PROVIDE_HIDDEN (__exidx_end = .);} + ${RELOCATING+PROVIDE_HIDDEN (.ARM.exidx\$\$Limit = .);} + }" MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" diff --git a/ld/emulparams/elf32_tic6x_le.sh b/ld/emulparams/elf32_tic6x_le.sh index 7bf7bf1ddf6..9ef4c171a5c 100644 --- a/ld/emulparams/elf32_tic6x_le.sh +++ b/ld/emulparams/elf32_tic6x_le.sh @@ -32,9 +32,12 @@ SBSS_NAME="bss" BSS_NAME="far" OTHER_READONLY_SECTIONS=" .c6xabi.extab ${RELOCATING-0} : { *(.c6xabi.extab${RELOCATING+* .gnu.linkonce.c6xabiextab.*}) } - ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); } - .c6xabi.exidx ${RELOCATING-0} : { *(.c6xabi.exidx${RELOCATING+* .gnu.linkonce.c6xabiexidx.*}) } - ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }" + .c6xabi.exidx ${RELOCATING-0} : + { + ${RELOCATING+PROVIDE_HIDDEN (__exidx_start = .);} + *(.c6xabi.exidx${RELOCATING+* .gnu.linkonce.c6xabiexidx.*}) + ${RELOCATING+PROVIDE_HIDDEN (__exidx_end = .);} + }" OTHER_SDATA_SECTIONS=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.*}) }" OTHER_READONLY_RELOC_SECTIONS=" .rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.*}) } |