[PATCH] x86/gas: Fix APX TLS IE restrictions

Kong, Lingling lingling.kong@intel.com
Thu Jul 4 09:37:43 GMT 2024


Add the restriction in assemble for APX TLS IE that the destination can only be a register.

gas/

      * config/tc-i386.c (md_assemble): Added stricter restrictions
      for APX TLS IE.
---
 gas/config/tc-i386.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 3b4d9cacc2e..2382db23e19 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -7544,9 +7544,8 @@ md_assemble (char *line)
 		&& i.mem_operands == 1
 		&& i.base_reg
 		&& i.base_reg->reg_num == RegIP
-		&& i.tm.operand_types[0].bitfield.class == Reg
-		&& (i.tm.operand_types[2].bitfield.class == Reg
-		    || i.tm.operands == 2))
+		&& i.reg_operands == (i.operands - 1)
+		&& i.types[i.operands - 1].bitfield.class == Reg)
 	      /* Allow APX:
 		 add %reg1, foo@gottpoff(%rip), %reg2
 		 add foo@gottpoff(%rip), %reg, %reg2
--
2.31.1



More information about the Binutils mailing list