From df212a7e7fb2c54096f004f62e10e47538c543c7 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 6 May 2002 13:47:55 +0000 Subject: [PATCH] Fix check for overflow of relocation for the Thumb BL instruction. --- bfd/ChangeLog | 5 +++++ bfd/elf32-arm.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1545df80b18..1f0e6d0e2b5 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-05-06 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Convert + 'reloc_signed_max' and 'reloc_signed_min' into half-word offsets. + 2002-05-06 Alan Modra * elflink.h (elf_link_input_bfd ): Adjust r_offset diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index 217666f9abc..51c51a47be7 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -1390,7 +1390,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, boolean overflow = false; bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data); bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2); - bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1; + bfd_signed_vma reloc_signed_max = ((1 << (howto->bitsize - 1)) - 1) >> howto->rightshift; bfd_signed_vma reloc_signed_min = ~ reloc_signed_max; bfd_vma check; bfd_signed_vma signed_check; -- 2.30.2