Author: ian
Date: Tue Dec 29 15:23:03 2015
New Revision: 292870
URL: https://svnweb.freebsd.org/changeset/base/292870

Log:
  Correct the code for sign-extending a 16 bit value.  As near as I can tell
  this is effectively a no-op -- the addend term in MOVT/MOVW relocations
  always seems to be zero.  But this is correct and the old code wasn't.

Modified:
  head/contrib/binutils/bfd/elf32-arm.c

Modified: head/contrib/binutils/bfd/elf32-arm.c
==============================================================================
--- head/contrib/binutils/bfd/elf32-arm.c       Tue Dec 29 12:38:04 2015        
(r292869)
+++ head/contrib/binutils/bfd/elf32-arm.c       Tue Dec 29 15:23:03 2015        
(r292870)
@@ -5800,7 +5800,7 @@ elf32_arm_final_link_relocate (reloc_how
        if (globals->use_rel)
          {
            addend = ((insn >> 4) & 0xf000) | (insn & 0xfff);
-           signed_addend = (addend ^ 0x10000) - 0x10000;
+           signed_addend = (addend ^ 0x8000) - 0x8000;
          }
 
        value += signed_addend;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to