sparc/sol2.h has its own definition of ASM_OUTPUT_ALIGNED_COMMON,
overriding the elfos.h version.  This was introduced back in 2010 as a
workaround for a bug in old versions of the Solaris/SPARC assembler (PR
target/38118).  However, even the Solaris 11.4 FCS as, the oldest one
currently supported, doesn't have this bug any longer.  Besides, the
workaround hasn't been effective anymore since GCC 10 without ill
effect.

Therefore the override definition can simply be removed.

Bootstrapped without regression on sparc-sun-solaris2.11 (as and gas).

Ok for trunk?

        Rainer

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


2026-01-09  Rainer Orth  <[email protected]>

        gcc:
        PR target/38118
        * config/sparc/sol2.h (ASM_OUTPUT_ALIGNED_COMMON): Remove.

# HG changeset patch
# Parent  b6ef672777eb7be448ad79372233c787d4e1e957
Remove Solaris/SPARC ASM_OUTPUT_ALIGNED_COMMON [PR38118]

diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -388,23 +388,6 @@ extern const char *host_detect_local_cpu
     }									\
   while (0)
 
-/* Solaris as has a bug: a .common directive in .tbss or .tdata section
-   behaves as .tls_common rather than normal non-TLS .common.  */
-#undef  ASM_OUTPUT_ALIGNED_COMMON
-#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN)		\
-  do									\
-    {									\
-      if (TARGET_SUN_TLS						\
-	  && in_section							\
-	  && ((in_section->common.flags & SECTION_TLS) == SECTION_TLS))	\
-	switch_to_section (bss_section);				\
-      fprintf ((FILE), "%s", COMMON_ASM_OP);				\
-      assemble_name ((FILE), (NAME));					\
-      fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",		\
-	       (SIZE), (ALIGN) / BITS_PER_UNIT);			\
-    }									\
-  while (0)
-
 #if !HAVE_GNU_AS
 /* This is how to output an assembler line that says to advance
    the location counter to a multiple of 2**LOG bytes using the

Reply via email to