* elf32-arm.c (arm_type_of_stub): Don't use ST_BRANCH_TO_ARM for
authorNick Clifton <nickc@redhat.com>
Thu, 18 Jul 2013 12:00:26 +0000 (12:00 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 18 Jul 2013 12:00:26 +0000 (12:00 +0000)
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.

bfd/ChangeLog
bfd/elf32-arm.c
ld/testsuite/ChangeLog
ld/testsuite/ld-arm/thumb-b-lks-sym.d
ld/testsuite/ld-arm/thumb-bl-lks-sym.d

index df25bd4e848a3113a60506fae399e16cff83de5c..ecd2842abb2d58c843ec5d0038fba66256ad1a10 100644 (file)
@@ -1,3 +1,9 @@
+2013-07-18  Terry Guo  <terry.guo@arm.com>
+
+        * elf32-arm.c (arm_type_of_stub): Don't use ST_BRANCH_TO_ARM for
+       thumb only targets.
+        (elf32_arm_final_link_relocate): Likewise.
+
 2013-07-18  Bill Neubauer  <wcn@google.com>
 
        * mach-o.c (mach_o_section_name_xlat dw): Add entry for
index 427ac6d1c020ea080892fd34480ee3f6bb083679..8f888391cfa5bc973e9d671a03f7355dc55d9dc2 100644 (file)
@@ -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;
index 652474d7f3fdcf39db0b78953820fbffe322f3e7..9eeb006c8ccc1b2c3c3321c78b0c61bde971a331 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-18  Terry Guo  <terry.guo@arm.com>
+
+        * ld-arm/thumb-b-lks-sym.d: Updated to be more flexible.
+        * ld-arm/thumb-bl-lks-sym.d: Likewise.
+
 2013-07-18  Roland McGrath  <mcgrathr@google.com>
 
        * ld-arm/farcall-arm-nacl.d: New file.
index eadd9a44d5741ef1ad8e4e4d0d7bce11ee964fae..cc23bc3e524137d72cdb24edb599502b1d58c0d0 100644 (file)
@@ -4,4 +4,4 @@
 Disassembly of section .text:
 
 00000000 <main>:
-   0:  f000 bffe       b.w     1000 <extFunc>
+   0:  f000 bffe       b.w     1000 <.*>
index b553b518e1e546d39afe837ab5414f05f437dfcd..1da6928ecd27dc072a6a58223675d4ec5efafaf4 100644 (file)
@@ -6,7 +6,7 @@ Disassembly of section .text:
 00000000 <main>:
    0:  b580            push    {r7, lr}
    2:  af00            add     r7, sp, #0
-   4:  f000 fffc       bl      1000 <extFunc>
+   4:  f000 fffc       bl      1000 <.*>
    8:  bd80            pop     {r7, pc}
    a:  bf00            nop
 
This page took 0.056619 seconds and 4 git commands to generate.