aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-03-21 15:13:35 +0100
committerJan Beulich <jbeulich@suse.com>2022-03-21 15:13:35 +0100
commit46fb6d5aa27d7129f472729a4f7ab8aa103aa674 (patch)
tree4a08cc0a23186e11ecc4132979ea558f2fc36f8b /gas/config
parent4b19214f7920a4dbb7acf42a4da667600d23bd6a (diff)
downloadgdb-46fb6d5aa27d7129f472729a4f7ab8aa103aa674.zip
gdb-46fb6d5aa27d7129f472729a4f7ab8aa103aa674.tar.gz
gdb-46fb6d5aa27d7129f472729a4f7ab8aa103aa674.tar.bz2
x86: don't suppress overflow diagnostics in x32 mode
Unlike in 64-bit mode, where values wrap at the 64-bit boundary anyway, there's no wrapping at the 32-bit boundary here, and hence overflow detection shouldn't be suppressed just because rela relocations are going to be used. The extra check against NO_RELOC is actually a result of an ilp32 test otherwise failing. But thinking about it, reporting overflows for not-really-relocations (typically because of earlier errors) makes little sense in general. Perhaps this should even be extended to non- 64-bit modes.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 83975c3..afb8b70 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -12769,7 +12769,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
#endif
else if (use_rela_relocations)
{
- fixP->fx_no_overflow = 1;
+ if (!disallow_64bit_reloc || fixP->fx_r_type == NO_RELOC)
+ fixP->fx_no_overflow = 1;
/* Remember value for tc_gen_reloc. */
fixP->fx_addnumber = value;
value = 0;