From 59a330f5e806f118d2ebdd590b3fe314673de2d5 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 3 Mar 2023 14:04:32 +0100 Subject: [PATCH] x86: allow for multiple immediates in output_disp() .insn isn't going to have a constraint of only a single immediate when, in particular, RIP-relative addressing is used. --- gas/config/tc-i386.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 50370ac2b8e..3e51e3028c6 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -10065,13 +10065,13 @@ output_disp (fragS *insn_start_frag, offsetT insn_start_off) if (operand_type_check (i.types[n1], imm)) { /* Only one immediate is allowed for PC - relative address. */ - gas_assert (sz == 0); - sz = imm_size (n1); - i.op[n].disps->X_add_number -= sz; + relative address, except with .insn. */ + gas_assert (sz == 0 || dot_insn ()); + sz += imm_size (n1); } - /* We should find the immediate. */ + /* We should find at least one immediate. */ gas_assert (sz != 0); + i.op[n].disps->X_add_number -= sz; } p = frag_more (size);