x86: allow for multiple immediates in output_disp()
authorJan Beulich <jbeulich@suse.com>
Fri, 31 Mar 2023 06:21:56 +0000 (08:21 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 31 Mar 2023 06:21:56 +0000 (08:21 +0200)
.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

index fe59bf3b5401cfa0e653847c3336b650fe8809ff..c8e68d5bc5d78e008d6c7b576762e4cce82ac3e5 100644 (file)
@@ -10050,13 +10050,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);