From f4f723a0638d45ff26d233cbfe70089084d27a91 Mon Sep 17 00:00:00 2001 From: Andrew Hsieh Date: Mon, 23 Jul 2012 10:58:01 -0700 Subject: Fix error: unresolvable R_ARM_THM_CALL relocation Backport of fix in cvs binutils 1.277 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-arm.c.diff?cvsroot=src&r1=text&tr1=1.277&r2=text&tr2=1.276&f=u Related issue & thread http://code.google.com/p/android/issues/detail?id=35342 https://groups.google.com/forum/?fromgroups#!topic/android-ndk/HaLycHImqL8 Change-Id: Iee449ff9ed8effe6591aee5258eed502c7a484de --- binutils-2.21/bfd/elf32-arm.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/binutils-2.21/bfd/elf32-arm.c b/binutils-2.21/bfd/elf32-arm.c index 4e695c6..ee920b7 100644 --- a/binutils-2.21/bfd/elf32-arm.c +++ b/binutils-2.21/bfd/elf32-arm.c @@ -7177,10 +7177,15 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, sym_sec, h, rel, globals, stub_type); - if (stub_entry != NULL) - value = (stub_entry->stub_offset - + stub_entry->stub_sec->output_offset - + stub_entry->stub_sec->output_section->vma); + { + if (stub_entry != NULL) + value = (stub_entry->stub_offset + + stub_entry->stub_sec->output_offset + + stub_entry->stub_sec->output_section->vma); + + if (h && h->plt.offset != (bfd_vma) -1) + *unresolved_reloc_p = FALSE; + } } else { @@ -7607,9 +7612,14 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, rel, globals, stub_type); if (stub_entry != NULL) - value = (stub_entry->stub_offset - + stub_entry->stub_sec->output_offset - + stub_entry->stub_sec->output_section->vma); + { + value = (stub_entry->stub_offset + + stub_entry->stub_sec->output_offset + + stub_entry->stub_sec->output_section->vma); + + if (h && h->plt.offset != (bfd_vma) -1) + *unresolved_reloc_p = FALSE; + } /* If this call becomes a call to Arm, force BLX. */ if (globals->use_blx && (r_type == R_ARM_THM_CALL)) -- cgit v1.1