x86: fix Solaris testsuite failures

Message ID 0424efb4-5c61-43bf-8f67-578c5fee03d1@suse.com
State New
Headers
Series x86: fix Solaris testsuite failures |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Testing passed

Commit Message

Jan Beulich March 15, 2024, 9:31 a.m. UTC
  For one 0afc614c9938 ("x86: Warn .insn instruction with length > 15
bytes") introduced a .insn use involving a slash; such tests need to
have --divide passed to gas.

And then 5bc71c2a6b8e ("x86-64: Add R_X86_64_CODE_6_GOTTPOFF") broke
BFD_RELOC_X86_64_GOTTPOFF conversion to R_X86_64_CODE_4_GOTTPOFF, by
adding respective code in a section guarded by
generate_relax_relocations (the case of that not being required there
was limited to 32-bit object files). Re-arrange that block of code to
check generate_relax_relocations later.
  

Patch

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -12161,10 +12161,6 @@  output_disp (fragS *insn_start_frag, off
 		 instructions without data prefix.  Always generate
 		 R_386_GOT32X for "sym*GOT" operand in 32-bit mode.  */
 	      if (i.prefix[DATA_PREFIX] == 0
-		  && (generate_relax_relocations
-		      || (!object_64bit
-			  && i.rm.mode == 0
-			  && i.rm.regmem == 5))
 		  && (i.rm.mode == 2
 		      || (i.rm.mode == 0 && i.rm.regmem == 5))
 		  && i.tm.opcode_space == SPACE_BASE
@@ -12184,7 +12180,7 @@  output_disp (fragS *insn_start_frag, off
 			  if (is_apx_rex2_encoding ())
 			    fixP->fx_tcbit = 1;
 			}
-		      else
+		      else if (generate_relax_relocations)
 			{
 			  /* Set fx_tcbit3 for REX2 prefix.  */
 			  if (is_apx_rex2_encoding ())
@@ -12195,7 +12191,8 @@  output_disp (fragS *insn_start_frag, off
 			    fixP->fx_tcbit = 1;
 			}
 		    }
-		  else
+		  else if (generate_relax_relocations
+			   || (i.rm.mode == 0 && i.rm.regmem == 5))
 		    fixP->fx_tcbit2 = 1;
 		}
 	    }
--- a/gas/testsuite/gas/i386/x86-64.exp
+++ b/gas/testsuite/gas/i386/x86-64.exp
@@ -166,7 +166,7 @@  run_list_test "suffix-bad"
 run_list_test "x86-64-suffix-bad"
 run_list_test "unspec64" ""
 run_list_test "prefix64" "-al"
-run_list_test "oversized64" "-al"
+run_list_test "oversized64" "-al --divide"
 run_dump_test "x86-64-fxsave"
 run_dump_test "x86-64-fxsave-intel"
 run_dump_test "x86-64-arch-1"