]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/ChangeLog binutils-2_22-branch
authorYufeng Zhang <yufeng.zhang@arm.com>
Fri, 16 Nov 2012 18:44:06 +0000 (18:44 +0000)
committerYufeng Zhang <yufeng.zhang@arm.com>
Fri, 16 Nov 2012 18:44:06 +0000 (18:44 +0000)
2012-11-16  Joey Ye  <joey.ye@arm.com>

* elf32-arm.c (elf32_arm_final_link_relocate,
case R_ARM_THM_ALU_PREL_11_0, case R_ARM_THM_PC12): Align address of
the place being relocated.
(elf32_arm_final_link_relocate, case R_ARM_THM_PC8): Align address
of the place being relocated and truncate addend.
(Pa): New macro.

bfd/ChangeLog
bfd/elf32-arm.c

index a568f1b33eb77692a7fc3cc1cbec8dd8c13f7eb3..c7eb35b6cd8b5f05fb8047ec798e73712d80ae4a 100644 (file)
@@ -1,3 +1,12 @@
+2012-11-16  Joey Ye  <joey.ye@arm.com>
+
+       * elf32-arm.c (elf32_arm_final_link_relocate, 
+       case R_ARM_THM_ALU_PREL_11_0, case R_ARM_THM_PC12): Align address of
+       the place being relocated.
+       (elf32_arm_final_link_relocate, case R_ARM_THM_PC8): Align address
+       of the place being relocated and truncate addend.
+       (Pa): New macro.
+
 2012-05-11  Ralf Corsépius  <ralf.corsepius@rtems.org>
 
        Backport from mainline:
index 9355f6651d507eccf685ef1f0b8ef34237a836ad..deb71f172d1f937327863dd0ff9775db4fee3fb7 100644 (file)
@@ -1,6 +1,6 @@
 /* 32-bit ELF support for ARM
    Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-   2008, 2009, 2010, 2011  Free Software Foundation, Inc.
+   2008, 2009, 2010, 2011, 2012  Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -61,6 +61,9 @@
 #define ARM_ELF_ABI_VERSION            0
 #define ARM_ELF_OS_ABI_VERSION         ELFOSABI_ARM
 
+/* The Adjusted Place, as defined by AAELF.  */
+#define Pa(X) ((X) & 0xfffffffc)
+
 static bfd_boolean elf32_arm_write_section (bfd *output_bfd,
                                            struct bfd_link_info *link_info,
                                            asection *sec,
@@ -8441,9 +8444,9 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
           }
 
        relocation = value + signed_addend;
-       relocation -= (input_section->output_section->vma
-                      + input_section->output_offset
-                      + rel->r_offset);
+       relocation -= Pa (input_section->output_section->vma
+                         + input_section->output_offset
+                         + rel->r_offset);
 
         value = abs (relocation);
 
@@ -8473,12 +8476,12 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
        insn = bfd_get_16 (input_bfd, hit_data);
 
         if (globals->use_rel)
-         addend = (insn & 0x00ff) << 2;
+         addend = ((((insn & 0x00ff) << 2) + 4) & 0x3ff) -4;
 
        relocation = value + addend;
-       relocation -= (input_section->output_section->vma
-                      + input_section->output_offset
-                      + rel->r_offset);
+       relocation -= Pa (input_section->output_section->vma
+                         + input_section->output_offset
+                         + rel->r_offset);
 
         value = abs (relocation);
 
@@ -8513,9 +8516,9 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
           }
 
        relocation = value + signed_addend;
-       relocation -= (input_section->output_section->vma
-                      + input_section->output_offset
-                      + rel->r_offset);
+       relocation -= Pa (input_section->output_section->vma
+                         + input_section->output_offset
+                         + rel->r_offset);
 
         value = abs (relocation);