From 98da05bf2698b55b73453480a3fbb92f163d2c7b Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 7 May 2021 12:03:12 +0200 Subject: [PATCH] x86: don't mix disp and imm processing Surely disp processing should access the disp operand, not an imm one. This is not an active issue only because imms and disps are, at the moment, overlapping fields of the same union. --- gas/ChangeLog | 5 +++++ gas/config/tc-i386.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index ba307b85f63..b3a2cfc9650 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2021-05-07 Jan Beulich + + * config/tc-i386.c (output_disp): Use disps field instead of + imms one. + 2021-05-07 Jan Beulich * config/tc-i386.c (i386_finalize_immediate): Move register diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 7e1d1552438..d3441988e34 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -10000,7 +10000,7 @@ output_disp (fragS *insn_start_frag, offsetT insn_start_off) { reloc_type = BFD_RELOC_386_GOTPC; i.has_gotpc_tls_reloc = true; - i.op[n].imms->X_add_number += + i.op[n].disps->X_add_number += encoding_length (insn_start_frag, insn_start_off, p); } else if (reloc_type == BFD_RELOC_64) -- 2.30.2