[binutils-gdb] x86: fix Solaris testsuite failures

Jan Beulich jbeulich@sourceware.org
Fri Mar 22 08:09:03 GMT 2024


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

commit 820a77554e64dd26d8ec2b03b59846268730c8be
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Mar 22 09:08:51 2024 +0100

    x86: fix Solaris testsuite failures
    
    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.

Diff:
---
 gas/config/tc-i386.c              | 9 +++------
 gas/testsuite/gas/i386/x86-64.exp | 2 +-
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 735c59bbd54..6d35c87a1e1 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -12161,10 +12161,6 @@ output_disp (fragS *insn_start_frag, offsetT insn_start_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, offsetT insn_start_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, offsetT insn_start_off)
 			    fixP->fx_tcbit = 1;
 			}
 		    }
-		  else
+		  else if (generate_relax_relocations
+			   || (i.rm.mode == 0 && i.rm.regmem == 5))
 		    fixP->fx_tcbit2 = 1;
 		}
 	    }
diff --git a/gas/testsuite/gas/i386/x86-64.exp b/gas/testsuite/gas/i386/x86-64.exp
index f5a92098fe6..71364d4aff1 100644
--- 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"


More information about the Binutils-cvs mailing list