diff options
Diffstat (limited to 'bfd/elf32-arm.h')
-rw-r--r-- | bfd/elf32-arm.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index 0cf2f9c..f7ef578 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -1631,8 +1631,14 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, #ifdef USE_REL { bfd_vma val; - val = bfd_get_32 (input_bfd, contents + rel->r_offset); - val += (sec->output_offset + sym->st_value); + bfd_vma insn; + + insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + val = insn + ((sec->output_offset + sym->st_value) + >> howto->rightshift); + val &= howto->dst_mask; + val |= insn & ~(howto->dst_mask); + bfd_put_32 (input_bfd, val, contents + rel->r_offset); } #else |