2009-02-18 Christophe Lyon <christophe.lyon@st.com>
authorChristophe Lyon <christophe.lyon@st.com>
Wed, 18 Feb 2009 16:56:37 +0000 (16:56 +0000)
committerChristophe Lyon <christophe.lyon@st.com>
Wed, 18 Feb 2009 16:56:37 +0000 (16:56 +0000)
bfd/
* elf32-arm.c (arm_build_one_stub): Fix relocation target for pic
stub. Catch default case error.
(arm_map_one_stub): Add missing Thumb mapping symbol.

testsuite/
* ld-arm/farcall-arm-arm-pic-veneer.d,
ld-arm/farcall-arm-thumb-blx-pic-veneer.d,
ld-arm/farcall-arm-thumb-pic-veneer.d,
ld-arm/farcall-thumb-arm-blx-pic-veneer.d,
ld-arm/farcall-thumb-thumb-blx-pic-veneer.d: Fix expected stub
target.

bfd/ChangeLog
bfd/elf32-arm.c
ld/testsuite/ChangeLog
ld/testsuite/ld-arm/farcall-arm-arm-pic-veneer.d
ld/testsuite/ld-arm/farcall-arm-thumb-blx-pic-veneer.d
ld/testsuite/ld-arm/farcall-arm-thumb-pic-veneer.d
ld/testsuite/ld-arm/farcall-thumb-arm-blx-pic-veneer.d
ld/testsuite/ld-arm/farcall-thumb-thumb-blx-pic-veneer.d

index 977c9ab962d9fa9a3531981d778eda68240fde63..81115920e926fbf7047733adce5d778daf3e5237 100644 (file)
@@ -1,3 +1,9 @@
+2009-02-18  Christophe Lyon  <christophe.lyon@st.com>
+
+       * elf32-arm.c (arm_build_one_stub): Fix relocation target for pic
+       stub. Catch default case error.
+       (arm_map_one_stub): Add missing Thumb mapping symbol.
+
 2009-02-18  Bjoern Haase  <bjoern.m.haase@web.de>
 
        PR 9841
index b1129d8b465ffe3a27cf7c71f4b75474a0672304..04f54054915c171879f8ecfbf4687627e92e3386 100644 (file)
@@ -2069,7 +2069,7 @@ static const bfd_vma elf32_arm_stub_long_branch_any_any_pic[] =
   {
     0xe59fc000,         /* ldr   r12, [pc] */
     0xe08ff00c,         /* add   pc, pc, ip */
-    0x00000000,         /* dcd   R_ARM_REL32(X) */
+    0x00000000,         /* dcd   R_ARM_REL32(X-4) */
   };
 
 /* Section name for stubs is the associated section name plus this
@@ -3208,9 +3208,10 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry,
         start of the stub.  */
       _bfd_final_link_relocate (elf32_arm_howto_from_type (R_ARM_REL32),
                                stub_bfd, stub_sec, stub_sec->contents,
-                               stub_entry->stub_offset + 8, sym_value, 0);
+                               stub_entry->stub_offset + 8, sym_value, -4);
       break;
     default:
+      BFD_FAIL();
       break;
     }
 
@@ -11704,6 +11705,8 @@ arm_map_one_stub (struct bfd_hash_entry * gen_entry,
     case arm_stub_short_branch_v4t_thumb_arm:
       if (!elf32_arm_output_stub_sym (osi, stub_name, addr | 1, 8))
        return FALSE;
+      if (!elf32_arm_output_map_sym (osi, ARM_MAP_THUMB, addr))
+       return FALSE;
       if (!elf32_arm_output_map_sym (osi, ARM_MAP_ARM, addr + 4))
        return FALSE;
       break;
index e579742200c0e1550c315f0294cb5f6cf8c50579..c1ab26fa76e6bb088d9867f4d14d7a9867dee7b5 100644 (file)
@@ -1,3 +1,12 @@
+2009-02-18  Christophe Lyon  <christophe.lyon@st.com>
+
+       * ld-arm/farcall-arm-arm-pic-veneer.d,
+       ld-arm/farcall-arm-thumb-blx-pic-veneer.d,
+       ld-arm/farcall-arm-thumb-pic-veneer.d,
+       ld-arm/farcall-thumb-arm-blx-pic-veneer.d,
+       ld-arm/farcall-thumb-thumb-blx-pic-veneer.d: Fix expected stub
+       target.
+
 2009-02-06  Joseph Myers  <joseph@codesourcery.com>
 
        * lib/ld-lib.exp (check_gc_sections_available): Return 0 for
index 1fd79a7e690b77ef043c1af964377c6afeb6ff63..39fb5c89ce6ea51f69a7e97b3c84e7f8a4d10793 100644 (file)
@@ -5,7 +5,7 @@ Disassembly of section .text:
 00001000 <__bar_veneer>:
     1000:      e59fc000        ldr     ip, \[pc, #0\]  ; 1008 <__bar_veneer\+0x8>
     1004:      e08ff00c        add     pc, pc, ip
-    1008:      02000018        .word   0x02000018
+    1008:      02000014        .word   0x02000014
     100c:      00000000        .word   0x00000000
 
 00001010 <_start>:
index 4fbba82bd3e991449141fc6a20b36262f5bd4f98..ede0c84e4314499ba48032d714998e82f187be49 100644 (file)
@@ -5,7 +5,7 @@ Disassembly of section .text:
 00001000 <__bar_from_arm>:
     1000:      e59fc000        ldr     ip, \[pc, #0\]  ; 1008 <__bar_from_arm\+0x8>
     1004:      e08ff00c        add     pc, pc, ip
-    1008:      0200000d        .word   0x0200000d
+    1008:      02000009        .word   0x02000009
     100c:      00000000        .word   0x00000000
 
 00001010 <_start>:
index 4fbba82bd3e991449141fc6a20b36262f5bd4f98..ede0c84e4314499ba48032d714998e82f187be49 100644 (file)
@@ -5,7 +5,7 @@ Disassembly of section .text:
 00001000 <__bar_from_arm>:
     1000:      e59fc000        ldr     ip, \[pc, #0\]  ; 1008 <__bar_from_arm\+0x8>
     1004:      e08ff00c        add     pc, pc, ip
-    1008:      0200000d        .word   0x0200000d
+    1008:      02000009        .word   0x02000009
     100c:      00000000        .word   0x00000000
 
 00001010 <_start>:
index db4df3cdf97101e349f278e23fd33cbbcad9df00..c824c5f0f821fc534534c69f2f852ae0c4aca8a5 100644 (file)
@@ -5,7 +5,7 @@ Disassembly of section .text:
 00001000 <__bar_from_thumb>:
     1000:      e59fc000        ldr     ip, \[pc, #0\]  ; 1008 <__bar_from_thumb\+0x8>
     1004:      e08ff00c        add     pc, pc, ip
-    1008:      0200000c        .word   0x0200000c
+    1008:      02000008        .word   0x02000008
     100c:      00000000        .word   0x00000000
 
 00001010 <_start>:
index 06107b7170b3a1e216693be8f20287e32d1e801e..b6e337169fd808ee6a3f2b0e1fdb1982c550c60a 100644 (file)
@@ -5,7 +5,7 @@ Disassembly of section .text:
 00001000 <__bar_veneer>:
     1000:      e59fc000        ldr     ip, \[pc, #0\]  ; 1008 <__bar_veneer\+0x8>
     1004:      e08ff00c        add     pc, pc, ip
-    1008:      0200000d        .word   0x0200000d
+    1008:      02000009        .word   0x02000009
     100c:      00000000        .word   0x00000000
 
 00001010 <_start>: