https://gcc.gnu.org/g:1ab2eb5e7c7d59f9700b3dd4173c44caac75a921
commit r17-1913-g1ab2eb5e7c7d59f9700b3dd4173c44caac75a921 Author: Rainer Orth <[email protected]> Date: Fri Jun 26 10:24:57 2026 +0200 Remove HAVE_AS_IX86_DIFF_SECT_DELTA 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. 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. Diff: --- gcc/config.in | 7 ------- gcc/config/i386/sol2.h | 28 ---------------------------- gcc/configure | 38 -------------------------------------- gcc/configure.ac | 12 ------------ 4 files changed, 85 deletions(-) diff --git a/gcc/config.in b/gcc/config.in index a4fd5e0c1086..dcc903dda151 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -507,13 +507,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 index 1f7c8790c894..e29f276b0ce9 100644 --- a/gcc/config/i386/sol2.h +++ b/gcc/config/i386/sol2.h @@ -26,17 +26,6 @@ along with GCC; see the file COPYING3. If not see #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. If not see #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 index 1ef7ea3d4821..7a3cff9b03e1 100755 --- a/gcc/configure +++ b/gcc/configure @@ -29827,44 +29827,6 @@ if test $gcc_cv_as_ix86_swap = yes; then $as_echo "#define HAVE_AS_IX86_SWAP 1" >>confdefs.h -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 diff --git a/gcc/configure.ac b/gcc/configure.ac index 4e8269d03b6c..f8a6ecd4706a 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -4928,18 +4928,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
