x86-64: respect MOVABS when choosing alternative encodings

Message ID 46af6fa7-e2c2-f771-47e2-05124675b096@suse.com
State Accepted
Headers
Series x86-64: respect MOVABS when choosing alternative encodings |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Jan Beulich Jan. 27, 2023, 11:10 a.m. UTC
  The alternative encoding is valid for MOV, but there's no such thing for
MOVABS.
  

Patch

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -6888,7 +6888,8 @@  match_template (char mnem_suffix)
 	    continue;
 
 	  if (t->base_opcode == MOV_AX_DISP32
-	      && t->opcode_modifier.opcodespace == SPACE_BASE)
+	      && t->opcode_modifier.opcodespace == SPACE_BASE
+	      && t->mnem_off != MN_movabs)
 	    {
 	      /* Force 0x8b encoding for "mov foo@GOT, %eax".  */
 	      if (i.reloc[0] == BFD_RELOC_386_GOT32)