public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] x86: allow for multiple immediates in output_disp()
@ 2023-03-31  6:23 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2023-03-31  6:23 UTC (permalink / raw)
  To: bfd-cvs

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

commit e3bf0aade2db023594211b463a156515559fe55f
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Mar 31 08:21:56 2023 +0200

    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.

Diff:
---
 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 fe59bf3b540..c8e68d5bc5d 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-31  6:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31  6:23 [binutils-gdb] x86: allow for multiple immediates in output_disp() Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).