aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-05-19 09:14:40 +0200
committerJan Beulich <jbeulich@suse.com>2023-05-19 09:14:40 +0200
commitdf81d460b2d9ec7327a0c1ab2344d7ec62874ce0 (patch)
treec592a69a5ea76f735ee52f23b27f8e6e002c8b98 /gas
parentd89d987bd2fabbc2ee44b28ac2b01f4b301c770c (diff)
downloadgdb-df81d460b2d9ec7327a0c1ab2344d7ec62874ce0.zip
gdb-df81d460b2d9ec7327a0c1ab2344d7ec62874ce0.tar.gz
gdb-df81d460b2d9ec7327a0c1ab2344d7ec62874ce0.tar.bz2
x86: tighten extend-to-32bit-address conditions
In a442cac5084e ("ix86: wrap constants") I made the truncation condition too relaxed: Any indication of a mode that's possible with BFD64 only should avoid the truncation. Therefore, like in the other two cases of calls to extend_to_32bit_address(), also check whether we're generating a 64-bit object.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-i386.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index c0bf4fc..9efb1e5 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -11684,7 +11684,7 @@ i386_finalize_immediate (segT exp_seg ATTRIBUTE_UNUSED, expressionS *exp,
/* If not 64bit, sign/zero extend val, to account for wraparound
when !BFD64. */
- if (flag_code != CODE_64BIT)
+ if (flag_code != CODE_64BIT && !object_64bit)
exp->X_add_number = extend_to_32bit_address (exp->X_add_number);
}
#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT))
@@ -11976,7 +11976,7 @@ i386_finalize_displacement (segT exp_seg ATTRIBUTE_UNUSED, expressionS *exp,
If not 64bit, sign/zero extend val, to account for wraparound
when !BFD64. */
- if (flag_code != CODE_64BIT)
+ if (flag_code != CODE_64BIT && !object_64bit)
exp->X_add_number = extend_to_32bit_address (exp->X_add_number);
}