summaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-07-18 12:00:26 +0000
committerNick Clifton <nickc@redhat.com>2013-07-18 12:00:26 +0000
commita66575f190bd82e7b6291bb175e1307419346e43 (patch)
tree6f6555091362deccacf6417b570798b6c4311541 /bfd/elf32-arm.c
parent9f927081010166372cbfcb0e5757e1c50a458f69 (diff)
downloadbinutils-redhat-a66575f190bd82e7b6291bb175e1307419346e43.tar.gz
* elf32-arm.c (arm_type_of_stub): Don't use ST_BRANCH_TO_ARM for
thumb only targets. (elf32_arm_final_link_relocate): Likewise. * ld-arm/thumb-b-lks-sym.d: Updated to be more flexible. * ld-arm/thumb-bl-lks-sym.d: Likewise.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 427ac6d1c0..8f888391cf 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -3609,6 +3609,12 @@ arm_type_of_stub (struct bfd_link_info *info,
r_type = ELF32_R_TYPE (rel->r_info);
+ /* ST_BRANCH_TO_ARM is nonsense to thumb-only targets when we
+ are considering a function call relocation. */
+ if (thumb_only && (r_type == R_ARM_THM_CALL || r_type == R_ARM_THM_JUMP24)
+ && branch_type == ST_BRANCH_TO_ARM)
+ branch_type = ST_BRANCH_TO_THUMB;
+
/* For TLS call relocs, it is the caller's responsibility to provide
the address of the appropriate trampoline. */
if (r_type != R_ARM_TLS_CALL
@@ -8123,6 +8129,14 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
else
addend = signed_addend = rel->r_addend;
+ /* ST_BRANCH_TO_ARM is nonsense to thumb-only targets when we
+ are resolving a function call relocation. */
+ if (using_thumb_only (globals)
+ && (r_type == R_ARM_THM_CALL
+ || r_type == R_ARM_THM_JUMP24)
+ && branch_type == ST_BRANCH_TO_ARM)
+ branch_type = ST_BRANCH_TO_THUMB;
+
/* Record the symbol information that should be used in dynamic
relocations. */
dynreloc_st_type = st_type;