Fix calculation of R_ARM_RHM_ALU_PREL_11_0 relocation when used with a SUB instruction.
authorCasey Smith <clegg89@gmail.com>
Tue, 30 May 2017 14:07:56 +0000 (15:07 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 30 May 2017 14:07:56 +0000 (15:07 +0100)
PR ld/21523
* elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.

bfd/ChangeLog
bfd/elf32-arm.c

index 7879a482a2f1c0e28e79b8b14a67bb62f6d766b7..11a474ec04644f158f6ba7b8e6c665b92f97109a 100644 (file)
@@ -1,3 +1,9 @@
+2017-05-30  Casey Smith  <clegg89@gmail.com>
+
+       PR ld/21523
+       * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
+       value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
+
 2017-05-30  Anton Kolesov  Anton.Kolesov@synopsys.com
 
        * cpu-arc.c (arc_compatible): New function.
index 1725c222696b846c29cefdea1fd414d88626839f..9cd34cafdadb173100de097395d995620baca98f 100644 (file)
@@ -10506,7 +10506,9 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
                          + input_section->output_offset
                          + rel->r_offset);
 
-       value = relocation;
+       /* PR 21523: Use an absolute value.  The user of this reloc will
+          have already selected an ADD or SUB insn appropriately.  */
+       value = abs (relocation);
 
        if (value >= 0x1000)
          return bfd_reloc_overflow;