Remove Solaris/PowerPC support

Solaris/PowerPC was a shortlived Solaris port with limited hardware
support.  It was released with Solaris 2.5.1 back in 1996, with support
removed again only a year later in Solaris 2.6.  Since this is long
obsolete, this patch removes the remains of the support.

Tested by a cross to ppc-unknown-linux-gnu to ascertain the build didn't
get broken.

2025-09-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	bfd:
	* config.bfd <powerpc-*-solaris2*>: Remove.

	gas:
	* NEWS: Mention Solaris/PowerPC removal.

	* configure.ac <ppc-*-solaris*>: Remove.
	* configure: Regenerate.
	* configure.in: Regenerate.
	* configure.tgt <ppc-*-solaris*>: Remove.

	* config/tc-ppc.c (ppc_solaris_comment_chars): Remove.
	(ppc_eabi_comment_chars): Remove.
	(SOLARIS_P): Remove.
	(msolaris): Remove.
	(md_parse_option): Remove "solaris", "no-solaris" hangling.
	(md_show_usage): Likewise.
	(md_begin): Remove msolaris handling.
	* config/tc-ppc.h (ppc_comment_chars): Fix declaration.
	* stabs.c (s_stab_generic) [TC_PPC && OBJ_ELF]: Remove 4-arg
	.stabd support.

	* doc/as.texi (Overview, Target PowerPC options): Remove
	-msolaris, -mno-solaris.
	* doc/c-ppc.texi (PowerPC-Opts): Remove -msolaris, -mno-solaris.
	(PowerPC-Chars): Remove ! as line comment character.

	ld:
	* configure.tgt <powerpc*-*-solaris*>: Remove.
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 583f731..1bd99a9 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2025-09-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* config.bfd <powerpc-*-solaris2*>: Remove.
+
 2025-07-13  Nick Clifton  <nickc@redhat.com>
 
 	* 2.45 Branch point.
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 8448515..cc840c4 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -1146,8 +1146,7 @@
     targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec powerpc_elf64_fbsd_vec"
     ;;
   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
-  powerpc-*-solaris2* | powerpc-*-linux-* | powerpc-*-rtems* | \
-  powerpc-*-chorus*)
+  powerpc-*-linux-* | powerpc-*-rtems* | powerpc-*-chorus*)
     targ_defvec=powerpc_elf32_vec
     targ_selvecs="rs6000_xcoff_vec powerpc_elf32_le_vec powerpc_boot_vec"
     targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec"
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 95e8d4f..dd76915 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,28 @@
+2025-09-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* NEWS: Mention Solaris/PowerPC removal.
+
+	* configure.ac <ppc-*-solaris*>: Remove.
+	* configure: Regenerate.
+	* configure.in: Regenerate.
+	* configure.tgt <ppc-*-solaris*>: Remove.
+
+	* config/tc-ppc.c (ppc_solaris_comment_chars): Remove.
+	(ppc_eabi_comment_chars): Remove.
+	(SOLARIS_P): Remove.
+	(msolaris): Remove.
+	(md_parse_option): Remove "solaris", "no-solaris" hangling.
+	(md_show_usage): Likewise.
+	(md_begin): Remove msolaris handling.
+	* config/tc-ppc.h (ppc_comment_chars): Fix declaration.
+	* stabs.c (s_stab_generic) [TC_PPC && OBJ_ELF]: Remove 4-arg
+	.stabd support.
+
+	* doc/as.texi (Overview, Target PowerPC options): Remove
+	-msolaris, -mno-solaris.
+	* doc/c-ppc.texi (PowerPC-Opts): Remove -msolaris, -mno-solaris.
+	(PowerPC-Chars): Remove ! as line comment character.
+
 2025-07-13  Nick Clifton  <nickc@redhat.com>
 
 	* 2.45 Branch point.
diff --git a/gas/NEWS b/gas/NEWS
index b1edc04..4de0cfb 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -5,6 +5,8 @@
 
 * NaCl target support is removed.
 
+* Solaris/PowerPC target support is removed.
+
 * Add support for RISC-V standard extensions:
   sdtrig v1.0, ssstrict v1.0.
 
diff --git a/gas/config.in b/gas/config.in
index ba042ca..d6ce237 100644
--- a/gas/config.in
+++ b/gas/config.in
@@ -269,9 +269,6 @@
 /* Target OS. */
 #undef TARGET_OS
 
-/* Define if default target is PowerPC Solaris. */
-#undef TARGET_SOLARIS_COMMENT
-
 /* Target vendor. */
 #undef TARGET_VENDOR
 
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 0816c38..a92a464 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -134,22 +134,9 @@
 /* Generic assembler global variables which must be defined by all
    targets.  */
 
-#ifdef OBJ_ELF
 /* This string holds the chars that always start a comment.  If the
-   pre-processor is disabled, these aren't very useful.  The macro
-   tc_comment_chars points to this.  We use this, rather than the
-   usual comment_chars, so that we can switch for Solaris conventions.  */
-static const char ppc_solaris_comment_chars[] = "#!";
-static const char ppc_eabi_comment_chars[] = "#";
-
-#ifdef TARGET_SOLARIS_COMMENT
-const char *ppc_comment_chars = ppc_solaris_comment_chars;
-#else
-const char *ppc_comment_chars = ppc_eabi_comment_chars;
-#endif
-#else
-const char comment_chars[] = "#";
-#endif
+   pre-processor is disabled, these aren't very useful.  */
+const char ppc_comment_chars[] = "#";
 
 /* Characters which start a comment at the beginning of a line.  */
 const char line_comment_chars[] = "#";
@@ -993,15 +980,6 @@
 
 /* Flags to set in the elf header.  */
 static flagword ppc_flags = 0;
-
-/* Whether this is Solaris or not.  */
-#ifdef TARGET_SOLARIS_COMMENT
-#define SOLARIS_P true
-#else
-#define SOLARIS_P false
-#endif
-
-static bool msolaris = SOLARIS_P;
 #endif
 
 #ifdef OBJ_XCOFF
@@ -1247,17 +1225,6 @@
 	  set_target_endian = 1;
 	}
 
-      else if (strcmp (arg, "solaris") == 0)
-	{
-	  msolaris = true;
-	  ppc_comment_chars = ppc_solaris_comment_chars;
-	}
-
-      else if (strcmp (arg, "no-solaris") == 0)
-	{
-	  msolaris = false;
-	  ppc_comment_chars = ppc_eabi_comment_chars;
-	}
       else if (strcmp (arg, "spe2") == 0)
 	{
 	  ppc_cpu |= PPC_OPCODE_SPE2;
@@ -1445,10 +1412,6 @@
 -mbig, -mbig-endian, -be\n\
                         generate code for a big endian machine\n"));
   fprintf (stream, _("\
--msolaris               generate code for Solaris\n"));
-  fprintf (stream, _("\
--mno-solaris            do not generate code for Solaris\n"));
-  fprintf (stream, _("\
 -K PIC                  set EF_PPC_RELOCATABLE_LIB in ELF flags\n"));
   fprintf (stream, _("\
 -V                      print assembler version number\n"));
@@ -1891,7 +1854,7 @@
 
 #ifdef OBJ_ELF
   /* Set the ELF flags if desired.  */
-  if (ppc_flags && !msolaris)
+  if (ppc_flags)
     bfd_set_private_flags (stdoutput, ppc_flags);
 #endif
 
@@ -2359,7 +2322,7 @@
     }
 }
 
-/* Solaris pseduo op to change to the .rodata section.  */
+/* Solaris pseudo op to change to the .rodata section.  */
 static void
 ppc_elf_rdata (int xxx)
 {
diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h
index e568c42..ea520b6 100644
--- a/gas/config/tc-ppc.h
+++ b/gas/config/tc-ppc.h
@@ -226,7 +226,7 @@
 #define md_elf_section_flags(FLAGS, ATTR, TYPE)	ppc_section_flags (FLAGS, ATTR, TYPE)
 
 #define tc_comment_chars ppc_comment_chars
-extern const char *ppc_comment_chars;
+extern const char ppc_comment_chars[];
 
 #define md_elf_section_letter		ppc_elf_section_letter
 extern bfd_vma ppc_elf_section_letter (int, const char **);
diff --git a/gas/configure b/gas/configure
index 12d96a5..c6d27fb 100755
--- a/gas/configure
+++ b/gas/configure
@@ -12187,16 +12187,6 @@
 $as_echo "#define AIX_WEAK_SUPPORT 1" >>confdefs.h
 
 	;;
-      ppc-*-solaris*)
-	if test ${this_target} = $target; then
-
-$as_echo "#define TARGET_SOLARIS_COMMENT 1" >>confdefs.h
-
-	fi
-	if test x${endian} = xbig; then
-	  as_fn_error $? "Solaris must be configured little endian" "$LINENO" 5
-	fi
-	;;
     esac
 
     if test ${this_target} = $target ; then
diff --git a/gas/configure.ac b/gas/configure.ac
index 78fe021..4c7df3d 100644
--- a/gas/configure.ac
+++ b/gas/configure.ac
@@ -298,15 +298,6 @@
 	AC_DEFINE(AIX_WEAK_SUPPORT, 1,
 		  [Define if using AIX 5.2 value for C_WEAKEXT.])
 	;;
-      ppc-*-solaris*)
-	if test ${this_target} = $target; then
-	  AC_DEFINE(TARGET_SOLARIS_COMMENT, 1,
-		    [Define if default target is PowerPC Solaris.])
-	fi
-	if test x${endian} = xbig; then
-	  AC_MSG_ERROR(Solaris must be configured little endian)
-	fi
-	;;
     esac
 
     if test ${this_target} = $target ; then
diff --git a/gas/doc/as.texi b/gas/doc/as.texi
index 28fb6a6..9b8fb4b 100644
--- a/gas/doc/as.texi
+++ b/gas/doc/as.texi
@@ -539,7 +539,6 @@
    [@b{-mregnames}|@b{-mno-regnames}]
    [@b{-mrelocatable}|@b{-mrelocatable-lib}|@b{-K PIC}] [@b{-memb}]
    [@b{-mlittle}|@b{-mlittle-endian}|@b{-le}|@b{-mbig}|@b{-mbig-endian}|@b{-be}]
-   [@b{-msolaris}|@b{-mno-solaris}]
    [@b{-nops=@var{count}}]
 @end ifset
 @ifset PRU
diff --git a/gas/doc/c-ppc.texi b/gas/doc/c-ppc.texi
index fabc594..0a7278e 100644
--- a/gas/doc/c-ppc.texi
+++ b/gas/doc/c-ppc.texi
@@ -193,12 +193,6 @@
 @item -mbig, -mbig-endian, -be
 Generate code for a big endian machine.
 
-@item -msolaris
-Generate code for Solaris.
-
-@item -mno-solaris
-Do not generate code for Solaris.
-
 @item -nops=@var{count}
 If an alignment directive inserts more than @var{count} nops, put a
 branch at the beginning to skip execution of the nops.
@@ -242,11 +236,6 @@
 a logical line number directive (@pxref{Comments}) or a preprocessor
 control command (@pxref{Preprocessing}).
 
-If the assembler has been configured for the ppc-*-solaris* target
-then the @samp{!} character also acts as a line comment character.
-This can be disabled via the @option{-mno-solaris} command-line
-option.
-
 @cindex line separator, PowerPC
 @cindex statement separator, PowerPC
 @cindex PowerPC line separator
diff --git a/gas/stabs.c b/gas/stabs.c
index 49e2740..14cf1f2 100644
--- a/gas/stabs.c
+++ b/gas/stabs.c
@@ -297,26 +297,6 @@
       SKIP_WHITESPACE ();
     }
 
-#ifdef TC_PPC
-#ifdef OBJ_ELF
-  /* Solaris on PowerPC has decided that .stabd can take 4 arguments, so if we were
-     given 4 arguments, make it a .stabn */
-  else if (what == 'd')
-    {
-      char *save_location = input_line_pointer;
-
-      SKIP_WHITESPACE ();
-      if (*input_line_pointer == ',')
-	{
-	  input_line_pointer++;
-	  what = 'n';
-	}
-      else
-	input_line_pointer = save_location;
-    }
-#endif /* OBJ_ELF */
-#endif /* TC_PPC */
-
 #ifndef NO_LISTING
   if (listing)
     {
diff --git a/ld/ChangeLog b/ld/ChangeLog
index cefb100..d2b7b93 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,7 @@
+2025-09-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* configure.tgt <powerpc*-*-solaris*>: Remove.
+
 2025-08-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
 	* emulparams/elf64_sparc.sh (TEXT_START_ADDR): Move ...
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 0343010..df31897 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -703,7 +703,7 @@
 powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
   | powerpc*-*-linux* | powerpc*-*-netbsd* | powerpc*-*-openbsd* \
   | powerpc*-*-rtems* \
-  | powerpc*-*-solaris* | powerpc*-*-kaos* | powerpc*-*-vxworks*)
+  | powerpc*-*-kaos* | powerpc*-*-vxworks*)
 			case "${targ}" in
 			powerpc64*)
 			    targ_emul=elf64ppc