Fix check for overflow of relocation for the Thumb BL instruction.
authorNick Clifton <nickc@redhat.com>
Mon, 6 May 2002 13:47:55 +0000 (13:47 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 6 May 2002 13:47:55 +0000 (13:47 +0000)
bfd/ChangeLog
bfd/elf32-arm.h

index 1545df80b18cf1098630bf3f10c705c3238080c1..1f0e6d0e2b55da79020e45f2507f83f1dbcbf1c9 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-06  Nick Clifton  <nickc@cambridge.redhat.com>
+
+       * 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  <amodra@bigpond.net.au>
 
        * elflink.h (elf_link_input_bfd <emit_relocs>): Adjust r_offset
index 217666f9abc7ab1af48f47a36c58172707df2261..51c51a47be7fa0455899a6e3aa6cfafe1066024b 100644 (file)
@@ -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;