From a1f07058d3891f919d489b5df7301fc543d88dd9 Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 29 Dec 2015 15:23:03 +0000 Subject: 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. --- contrib/binutils/bfd/elf32-arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/binutils/bfd/elf32-arm.c b/contrib/binutils/bfd/elf32-arm.c index ca40eac..753cdcc 100644 --- a/contrib/binutils/bfd/elf32-arm.c +++ b/contrib/binutils/bfd/elf32-arm.c @@ -5800,7 +5800,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, if (globals->use_rel) { addend = ((insn >> 4) & 0xf000) | (insn & 0xfff); - signed_addend = (addend ^ 0x10000) - 0x10000; + signed_addend = (addend ^ 0x8000) - 0x8000; } value += signed_addend; -- cgit v1.1