aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-i386.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r--gas/config/tc-i386.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index ccf54bc..06f9764 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -9173,6 +9173,17 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
if (disallow_64bit_reloc)
switch (code)
{
+ case BFD_RELOC_64:
+ /* Check addend overflow. */
+ if ((long long) fixp->fx_offset > 0x7fffffffLL
+ || (long long) fixp->fx_offset < -0x80000000LL)
+ {
+ as_bad_where (fixp->fx_file, fixp->fx_line,
+ _("cannot represent relocation %s with addend %lld in x32 mode"),
+ bfd_get_reloc_code_name (code),
+ (long long) fixp->fx_offset);
+ }
+ break;
case BFD_RELOC_X86_64_DTPOFF64:
case BFD_RELOC_X86_64_TPOFF64:
case BFD_RELOC_64_PCREL: