Reproduced with: $ cat pcrel-shared.s .syntax unified .arm .arch armv7-a .text .globl foo .type foo,%function foo: movw r0, #:lower16:symbol - 1f - 8 movt r0, #:upper16:symbol - 1f - 8 1: add r0, pc bx lr .data .globl symbol .hidden symbol symbol: .long 22 $ arm-linux-gnueabi-as -o pcrel-shared.o pcrel-shared.s $ arm-linux-gnueabi-ld -shared -o pcrel-shared.so pcrel-shared.o $ readelf -dr pcrel-shared.so Dynamic section at offset 0x1e4 contains 10 entries: Tag Type Name/Value 0x00000004 (HASH) 0x94 0x00000005 (STRTAB) 0x184 0x00000006 (SYMTAB) 0xd4 0x0000000a (STRSZ) 63 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000011 (REL) 0x1c4 0x00000012 (RELSZ) 16 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x00000016 (TEXTREL) 0x0 0x00000000 (NULL) 0x0 Relocation section '.rel.dyn' at offset 0x1c4 contains 2 entries: Offset Info Type Sym.Value Sym. Name 00000000 00000000 R_ARM_NONE 00000000 00000000 R_ARM_NONE $ The R_ARM_NONE relocs are bogus. More important is the DT_TEXTREL marker, which is harmfully bogus. Appears in 2.24 (and earlier) and trunk du jour. Gold does not have this bug.
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The branch, master has been updated via 469a34932ae4208240e98c843b01ea1f00892137 (commit) from 01e6c1a48d2c56a5e8a78f54b3b2021da42257e7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=469a34932ae4208240e98c843b01ea1f00892137 commit 469a34932ae4208240e98c843b01ea1f00892137 Author: Roland McGrath <mcgrathr@google.com> Date: Wed Aug 20 10:12:57 2014 -0700 Fix PR ld/17277: bogus dynamic relocs and TEXTREL for ARM PC-relative relocs bfd/ PR ld/17277 * elf32-arm.c (elf32_arm_check_relocs): Increment P->pc_count for all reloc types with pc_relative set in the howto, not just for R_ARM_REL32 and R_ARM_REL32_NOI. (allocate_dynrelocs_for_symbol): Update comment. (elf32_arm_gc_sweep_hook): For all reloc types with pc_relative set in the howto, set call_reloc_p and may_need_local_target_p but not may_become_dynamic_p; not only for R_ARM_REL32 and R_ARM_REL32_NOI. (elf32_arm_check_relocs): Likewise. ld/testsuite/ PR ld/17277 * ld-arm/pcrel-shared.s: New file. * ld-arm/pcrel-shared.rd: New file. * ld-arm/arm-elf.exp (armelftests_common): Add it. ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 12 ++++++++++++ bfd/elf32-arm.c | 24 ++++++++++++------------ ld/testsuite/ChangeLog | 7 +++++++ ld/testsuite/ld-arm/arm-elf.exp | 4 ++++ ld/testsuite/ld-arm/pcrel-shared.rd | 16 ++++++++++++++++ ld/testsuite/ld-arm/pcrel-shared.s | 25 +++++++++++++++++++++++++ 6 files changed, 76 insertions(+), 12 deletions(-) create mode 100644 ld/testsuite/ld-arm/pcrel-shared.rd create mode 100644 ld/testsuite/ld-arm/pcrel-shared.s
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The branch, binutils-2_24-branch has been updated via b08b9f0894e43f0bb966f3ad9094a4405ce6f570 (commit) from b5d9ce2e84f5b750838c5ed115bfa69e27a6ac92 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b08b9f0894e43f0bb966f3ad9094a4405ce6f570 commit b08b9f0894e43f0bb966f3ad9094a4405ce6f570 Author: Roland McGrath <mcgrathr@google.com> Date: Wed Aug 20 10:12:57 2014 -0700 Fix PR ld/17277: bogus dynamic relocs and TEXTREL for ARM PC-relative relocs bfd/ PR ld/17277 * elf32-arm.c (elf32_arm_check_relocs): Increment P->pc_count for all reloc types with pc_relative set in the howto, not just for R_ARM_REL32 and R_ARM_REL32_NOI. (allocate_dynrelocs_for_symbol): Update comment. (elf32_arm_gc_sweep_hook): For all reloc types with pc_relative set in the howto, set call_reloc_p and may_need_local_target_p but not may_become_dynamic_p; not only for R_ARM_REL32 and R_ARM_REL32_NOI. (elf32_arm_check_relocs): Likewise. ld/testsuite/ PR ld/17277 * ld-arm/pcrel-shared.s: New file. * ld-arm/pcrel-shared.rd: New file. * ld-arm/arm-elf.exp (armelftests_common): Add it. (cherry picked from commit 469a34932ae4208240e98c843b01ea1f00892137) ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 12 ++++++++++++ bfd/elf32-arm.c | 18 +++++++++--------- ld/testsuite/ChangeLog | 7 +++++++ ld/testsuite/ld-arm/arm-elf.exp | 4 ++++ ld/testsuite/ld-arm/pcrel-shared.rd | 16 ++++++++++++++++ ld/testsuite/ld-arm/pcrel-shared.s | 25 +++++++++++++++++++++++++ 6 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 ld/testsuite/ld-arm/pcrel-shared.rd create mode 100644 ld/testsuite/ld-arm/pcrel-shared.s
Fixed on trunk and 2.24 now.