[3/4] x86: don't mix disp and imm processing

Message ID f12b710a-4e5e-5978-6d7b-8cbe992e4780@suse.com
State New
Headers show
  • x86: assorted relocation handling related adjustments (part IV)
Related show

Commit Message

H.J. Lu via Binutils May 6, 2021, 6:07 a.m.
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.

2021-05-XX  Jan Beulich  <jbeulich@suse.com>

	* config/tc-i386.c (output_disp): Use disps field instead of
	imms one.


--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -9998,7 +9998,7 @@  output_disp (fragS *insn_start_frag, 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)