aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorCasey Smith <clegg89@gmail.com>2017-05-30 15:07:56 +0100
committerNick Clifton <nickc@redhat.com>2017-05-30 15:07:56 +0100
commit8c65b54f18c03ffb844e1cbaa3b46b43444ff9e7 (patch)
tree0606501eb8de5698055334b81adc8f0aa7724d79 /bfd/elf32-arm.c
parent10045478d984f9924cb945423388ba25b7dd3ffe (diff)
downloadgdb-8c65b54f18c03ffb844e1cbaa3b46b43444ff9e7.zip
gdb-8c65b54f18c03ffb844e1cbaa3b46b43444ff9e7.tar.gz
gdb-8c65b54f18c03ffb844e1cbaa3b46b43444ff9e7.tar.bz2
Fix calculation of R_ARM_RHM_ALU_PREL_11_0 relocation when used with a SUB instruction.
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.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 1725c22..9cd34ca 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -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;