summaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2008-11-25 15:53:27 +0000
committerJoseph Myers <joseph@codesourcery.com>2008-11-25 15:53:27 +0000
commit1954000798df4fa1571ee51994105b75f31959d1 (patch)
treecca332ecbd384c8eec75a1fd5bdcd85ed9c096ef /bfd/elf32-arm.c
parent83bac4b0108234603a1674d820d0188c9f8c4e68 (diff)
downloadbinutils-gdb-1954000798df4fa1571ee51994105b75f31959d1.tar.gz
bfd:
* elf32-arm.c (elf32_arm_final_link_relocate): Do not turn branches to undefine weak symbols into branches to the next instruction if creating PLT entries for those symbols. ld/testsuite: * ld-arm/thumb2-bl-undefweak.d, ld-arm/thumb2-bl-undefweak.s: New. * ld-arm/arm-elf.exp: Run thumb2-bl-undefweak test.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 5b78dc3dfdd..cd5a9bfc071 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -6360,8 +6360,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
int thumb2 = using_thumb2 (globals);
/* A branch to an undefined weak symbol is turned into a jump to
- the next instruction. */
- if (h && h->root.type == bfd_link_hash_undefweak)
+ the next instruction unless a PLT entry will be created. */
+ if (h && h->root.type == bfd_link_hash_undefweak
+ && !(splt != NULL && h->plt.offset != (bfd_vma) -1))
{
bfd_put_16 (input_bfd, 0xe000, hit_data);
bfd_put_16 (input_bfd, 0xbf00, hit_data + 2);