Every supported version of the Solaris/x86 assembler supports
subtraction of symbols in different sections.  Therefore the
HAVE_AS_IX86_DIFF_SECT_DELTA is always defined with both as and gas and
can be removed.

Bootstrapped without regressions on i386-pc-solaris2.11,
amd64-pc-solaris2.11 with both the original Solaris 11.4 as and the
current one, and x86_64-pc-linux-gnu.

Committed to trunk.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2026-06-25  Rainer Orth  <[email protected]>

        gcc:
        * configure.ac (gcc_cv_as_ix86_diff_sect_delta): Remove.
        * configure: Regenerate.
        * config.in: Likewise.
        * config/i386/sol2.h [!HAVE_AS_IX86_DIFF_SECT_DELTA]
        (ASM_PREFERRED_EH_DATA_FORMAT): Remove.
        (JUMP_TABLES_IN_TEXT_SECTION): Likewise.
        (ASM_OUTPUT_DWARF_PCREL): Likewise.

# HG changeset patch
# Parent  a7bf1d740035ac7a5f5406966ce57089168fc539
Remove HAVE_AS_IX86_DIFF_SECT_DELTA

diff --git a/gcc/config.in b/gcc/config.in
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -513,13 +513,6 @@
 #endif
 
 
-/* Define if your assembler supports the subtraction of symbols in different
-   sections. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_AS_IX86_DIFF_SECT_DELTA
-#endif
-
-
 /* Define if your assembler supports the ffreep mnemonic. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_IX86_FFREEP
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -26,17 +26,6 @@ along with GCC; see the file COPYING3.  
 #undef STACK_REALIGN_DEFAULT
 #define STACK_REALIGN_DEFAULT (TARGET_64BIT ? 0 : 1)
 
-/* Old versions of the Solaris assembler cannot handle the difference of
-   labels in different sections, so force DW_EH_PE_datarel if so.  */
-#ifndef HAVE_AS_IX86_DIFF_SECT_DELTA
-#undef ASM_PREFERRED_EH_DATA_FORMAT
-#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)			\
-  (flag_pic ? ((GLOBAL ? DW_EH_PE_indirect : 0)				\
-	       | (TARGET_64BIT ? DW_EH_PE_pcrel | DW_EH_PE_sdata4	\
-		  : DW_EH_PE_datarel))					\
-   : DW_EH_PE_absptr)
-#endif
-
 /* The Solaris linker will not merge a read-only .eh_frame section
    with a read-write .eh_frame section.  None of the encodings used
    with non-PIC code require runtime relocations.  In 64-bit mode,
@@ -110,23 +99,6 @@ along with GCC; see the file COPYING3.  
 #undef ASM_QUAD
 #endif
 
-/* The native Solaris assembler can't calculate the difference between
-   symbols in different sections, which causes problems for -fPIC jump
-   tables in .rodata.  */
-#ifndef HAVE_AS_IX86_DIFF_SECT_DELTA
-#undef JUMP_TABLES_IN_TEXT_SECTION
-#define JUMP_TABLES_IN_TEXT_SECTION 1
-
-/* The native Solaris assembler cannot handle the SYMBOL-. syntax, but
-   requires SYMBOL@rel/@rel64 instead.  */
-#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL)	\
-  do {							\
-    fputs (integer_asm_op (SIZE, FALSE), FILE);		\
-    assemble_name (FILE, LABEL);			\
-    fputs (SIZE == 8 ? "@rel64" : "@rel", FILE);	\
-  } while (0)
-#endif
-
 /* The Solaris assembler wants a .local for non-exported aliases.  */
 #define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET)	\
   do {							\
diff --git a/gcc/configure b/gcc/configure
--- a/gcc/configure
+++ b/gcc/configure
@@ -29836,44 +29836,6 @@ $as_echo "#define HAVE_AS_IX86_SWAP 1" >
 fi
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for different section symbol subtraction" >&5
-$as_echo_n "checking assembler for different section symbol subtraction... " >&6; }
-if ${gcc_cv_as_ix86_diff_sect_delta+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  gcc_cv_as_ix86_diff_sect_delta=no
-  if test x"$gcc_cv_as" != x; then
-    $as_echo '.section .rodata
-.L1:
-        .long .L2-.L1
-        .long .L3-.L1
-        .text
-.L3:    nop
-.L2:    nop' > conftest.s
-    if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }
-    then
-	gcc_cv_as_ix86_diff_sect_delta=yes
-    else
-      echo "configure: failed program was" >&5
-      cat conftest.s >&5
-    fi
-    rm -f conftest.o conftest.s
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ix86_diff_sect_delta" >&5
-$as_echo "$gcc_cv_as_ix86_diff_sect_delta" >&6; }
-if test $gcc_cv_as_ix86_diff_sect_delta = yes; then
-
-$as_echo "#define HAVE_AS_IX86_DIFF_SECT_DELTA 1" >>confdefs.h
-
-fi
-
-
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for rep and lock prefix" >&5
 $as_echo_n "checking assembler for rep and lock prefix... " >&6; }
 if ${gcc_cv_as_ix86_rep_lock_prefix+:} false; then :
diff --git a/gcc/configure.ac b/gcc/configure.ac
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4950,18 +4950,6 @@ foo:	nop
       [AC_DEFINE(HAVE_AS_IX86_SWAP, 1,
         [Define if your assembler supports the swap suffix.])])
 
-    gcc_GAS_CHECK_FEATURE([different section symbol subtraction],
-      gcc_cv_as_ix86_diff_sect_delta,,
-      [.section .rodata
-.L1:
-        .long .L2-.L1
-        .long .L3-.L1
-        .text
-.L3:    nop
-.L2:    nop],,
-      [AC_DEFINE(HAVE_AS_IX86_DIFF_SECT_DELTA, 1,
-        [Define if your assembler supports the subtraction of symbols in different sections.])])
-
     gcc_GAS_CHECK_FEATURE([rep and lock prefix],
         gcc_cv_as_ix86_rep_lock_prefix,,
 	[rep movsl

Reply via email to