sh: Check UNDEFWEAK_NO_DYNAMIC_RELOC
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 14 Oct 2017 18:07:18 +0000 (11:07 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 14 Oct 2017 18:07:30 +0000 (11:07 -0700)
commit6ee6e05af482b356f9be4b0db877802fb47b2a12
tree697f6c9fa95a7b8e9356dd2f6b41022a8171e2e7
parentb27bb18f45a99330600ab57892c3620343425910
sh: 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-sh.c (allocate_dynrelocs): Discard dynamic relocations
if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
(sh_elf_relocate_section): Don't generate dynamic relocation if
UNDEFWEAK_NO_DYNAMIC_RELOC is true.
bfd/ChangeLog
bfd/elf32-sh.c