[PR ld/22269] arm: Avoid dynamic relocs for undefweak symbols in static PIE
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 9 Jan 2020 17:20:56 +0000 (17:20 +0000)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 10 Jan 2020 14:16:05 +0000 (14:16 +0000)
commit7f02673206eaef00f240b84c21069b4e5fbe09ea
treed9e07fb6af31f165aa84ca22d772a091ae86b583
parent8cd0e5e93145699736a370b271ff03f3f41670b0
[PR ld/22269] arm: Avoid dynamic relocs for undefweak symbols in static PIE

With static PIE linking undefined weak symbols are resolved to 0, so no
dynamic relocation is needed for them. The UNDEFWEAK_NO_DYNAMIC_RELOC
macro was introduced so this case can be handled easily, but it was not
applied consistently in the first attempt to fix ld/22269 for arm:

  commit 95b03e4ad68e7a90f5096b47df595636344b783a
  arm: Check UNDEFWEAK_NO_DYNAMIC_RELOC

This patch fixes spurious relative relocs in static PIE binaries against
GOT entries created for undefined weak symbols on arm*-*, this fixes

FAIL: pr22269-1 (static pie undefined weak)

bfd/ChangeLog:

PR ld/22269
* elf32-arm.c (elf32_arm_final_link_relocate): Use
UNDEFWEAK_NO_DYNAMIC_RELOC.
(allocate_dynrelocs_for_symbol): Likewise.
bfd/ChangeLog
bfd/elf32-arm.c
This page took 0.024241 seconds and 4 git commands to generate.