From: H.J. Lu Date: Mon, 13 Jul 2020 17:18:39 +0000 (-0700) Subject: x86: Remove 32-bit sign extension in offset_in_range X-Git-Tag: binutils-2_35~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed0e8aece0dc81f54e2593abac7eba3379705a8e;p=thirdparty%2Fbinutils-gdb.git x86: Remove 32-bit sign extension in offset_in_range When encoding a 32-bit offset, there is no need to sign-extend it to 64 bits since only the lower 32 bits are used. PR gas/26237 * config/tc-i386.c (offset_in_range): Remove 32-bit sign extension. (cherry picked from commit 7a705315596cf5effe01de8c3ac2535687c5663d) --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 5f6d5b2d693..0b1ac57e610 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2020-07-15 H.J. Lu + + PR gas/26237 + * config/tc-i386.c (offset_in_range): Remove 32-bit sign + extension. + 2020-07-15 Nick Clifton * write.c (create_note_reloc): Add desc2_size parameter. Zero out diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 2e0eb247535..c0c8a291e74 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2522,14 +2522,6 @@ offset_in_range (offsetT val, int size) default: abort (); } -#ifdef BFD64 - /* If BFD64, sign extend val for 32bit address mode. */ - if (flag_code != CODE_64BIT - || i.prefix[ADDR_PREFIX]) - if ((val & ~(((addressT) 2 << 31) - 1)) == 0) - val = (val ^ ((addressT) 1 << 31)) - ((addressT) 1 << 31); -#endif - if ((val & ~mask) != 0 && (val & ~mask) != ~mask) { char buf1[40], buf2[40];