arm: Check UNDEFWEAK_NO_DYNAMIC_RELOC
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 14 Oct 2017 17:27:33 +0000 (10:27 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 14 Oct 2017 17:32:46 +0000 (10:32 -0700)
commit95b03e4ad68e7a90f5096b47df595636344b783a
tree48aec6b6afbdb8bdb04fe5fa121c64897af76d40
parenta3cd202aae50abe5a571fb8c186b6b6af68edce2
arm: Check UNDEFWEAK_NO_DYNAMIC_RELOC

Don't generate dynamic relocation against weak undefined symbol if it
is resolved to zero.  FIXME: UNDEFWEAK_NO_DYNAMIC_RELOC may need to be
checked in more places.

PR ld/22269
* elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
(allocate_dynrelocs_for_symbol): Discard dynamic relocations
if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
bfd/ChangeLog
bfd/elf32-arm.c