[binutils-gdb] x86: don't mix disp and imm processing

Jan Beulich jbeulich@sourceware.org
Fri May 7 10:03:32 GMT 2021


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=98da05bf2698b55b73453480a3fbb92f163d2c7b

commit 98da05bf2698b55b73453480a3fbb92f163d2c7b
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri May 7 12:03:12 2021 +0200

    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.

Diff:
---
 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  <jbeulich@suse.com>
+
+	* config/tc-i386.c (output_disp): Use disps field instead of
+	imms one.
+
 2021-05-07  Jan Beulich  <jbeulich@suse.com>
 
 	* 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)


More information about the Binutils-cvs mailing list