From: rahnds Date: Sun, 26 Jan 1997 08:17:27 +0000 (+0000) Subject: change constant handling with @l. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8221f7855121073a39148fdcd99f3a4097f27396;p=openbsd change constant handling with @l. if the expected argument to the opcode is unsigned, return (val & 0xffff) if the expected argument to the occode is signed, sign extend the 16 bit value short = val; val = (int) short; --- diff --git a/gnu/usr.bin/binutils/gas/config/tc-ppc.c b/gnu/usr.bin/binutils/gas/config/tc-ppc.c index 1a0d297510d..485da742473 100644 --- a/gnu/usr.bin/binutils/gas/config/tc-ppc.c +++ b/gnu/usr.bin/binutils/gas/config/tc-ppc.c @@ -1772,12 +1772,14 @@ md_assemble (str) break; case BFD_RELOC_LO16: - if (ex.X_unsigned) - ex.X_add_number &= 0xffff; - else - ex.X_add_number = (((ex.X_add_number & 0xffff) - ^ 0x8000) - - 0x8000); + if (operand->flags & PPC_OPERAND_SIGNED) { + /* sign extend */ + signed short i; + i = ex.X_add_number; + ex.X_add_number = (int) i; + } else { + ex.X_add_number &= 0xffff; + } break; case BFD_RELOC_HI16: