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.
This commit is contained in:
Jan Beulich
2021-05-07 12:03:12 +02:00
parent 9aac24b1a8
commit 98da05bf26
2 changed files with 6 additions and 1 deletions

View File

@ -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> 2021-05-07 Jan Beulich <jbeulich@suse.com>
* config/tc-i386.c (i386_finalize_immediate): Move register * config/tc-i386.c (i386_finalize_immediate): Move register

View File

@ -10000,7 +10000,7 @@ output_disp (fragS *insn_start_frag, offsetT insn_start_off)
{ {
reloc_type = BFD_RELOC_386_GOTPC; reloc_type = BFD_RELOC_386_GOTPC;
i.has_gotpc_tls_reloc = true; 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); encoding_length (insn_start_frag, insn_start_off, p);
} }
else if (reloc_type == BFD_RELOC_64) else if (reloc_type == BFD_RELOC_64)