]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: fix Solaris testsuite failures
authorJan Beulich <jbeulich@suse.com>
Fri, 22 Mar 2024 08:08:51 +0000 (09:08 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 22 Mar 2024 08:08:51 +0000 (09:08 +0100)
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.

gas/config/tc-i386.c
gas/testsuite/gas/i386/x86-64.exp

index 735c59bbd5437da3861a35009185089e5bc85b1e..6d35c87a1e11565fbc558d07755491d4e97e61f6 100644 (file)
@@ -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;
                }
            }
index f5a92098fe61c8ffcf38d4a1074daf682a073f3a..71364d4aff1a6cc40071c319aca593365da5ac52 100644 (file)
@@ -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"