diff -r 54407e53229c config/gc++filt.m4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/gc++filt.m4	Mon Jun 28 10:36:05 2010 +0200
@@ -0,0 +1,26 @@
+# gc++filt.m4 serial 1					-*- Autoconf -*-
+# Find an instance of GNU c++filt on PATH.
+
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Rainer Orth.
+
+# GCC_PROG_GNU_CXXFILT
+# --------------------
+# Check for GNU c++filt.
+# FIXME: Maybe need TARGET variant, though c++filt should be target
+# independent.
+AC_DEFUN([GCC_PROG_GNU_CXXFILT],
+  [AC_ARG_VAR([CXXFILT], [Location of GNU c++filt.  Defaults to the first
+    GNU version of `c++filt', `gc++filt' on PATH.])
+  AC_CACHE_CHECK([for GNU c++filt], [ac_cv_path_CXXFILT],
+    [AC_PATH_PROGS_FEATURE_CHECK([CXXFILT], [c++filt gc++filt],
+      [_AC_PATH_PROG_FLAVOR_GNU([$ac_path_CXXFILT],
+	[ac_cv_path_CXXFILT=$ac_path_CXXFILT && ac_path_CXXFILT_found=:])])])
+  CXXFILT=$ac_cv_path_CXXFILT
+])
diff -r 54407e53229c contrib/make_sunver.pl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/make_sunver.pl	Mon Jun 28 10:36:05 2010 +0200
@@ -0,0 +1,280 @@
+#!/usr/bin/perl -w
+
+# make_sunver.pl
+#
+# This script takes at least two arguments, a GNU style version script and
+# a list of object and archive files, and generates a corresponding Sun
+# style version script as follows:
+#
+# Each glob pattern, C++ mangled pattern or literal in the input script is
+# matched against all global symbols in the input objects, emitting those
+# that matched (or nothing if no match was found).
+# A comment with the original pattern and its type is left in the output
+# file to make it easy to understand the matches.
+#
+# It expects a 'nm' with the POSIX '-P' option, but everyone has one of
+# those, right?
+# It depends on the GNU version of c++filt, since it must understand the
+# GNU mangling style.
+
+use File::Glob ':glob';
+use FileHandle;
+use IPC::Open2;
+
+# Input version script, GNU style.
+my $symvers = shift;
+
+##########
+# Get all the symbols from the library, match them, and add them to a hash.
+
+my %sym_hash = ();
+
+# List of objects and archives to process.
+my @OBJECTS = ();
+
+# List of shared objects to omit from processing.
+my @SHAREDOBJS = ();
+
+# Filter out those input archives that have corresponding shared objects to
+# avoid adding all symbols matched in the archive to the output map.
+foreach $file (@ARGV) {
+    if (($so = $file) =~ s/\.a$/.so/ && -e $so) {
+	printf STDERR "omitted $file -> $so\n";
+	push (@SHAREDOBJS, $so);
+    } else {
+	push (@OBJECTS, $file);
+    }
+}
+
+# The nm command to use.
+my $nm = $ENV{'NM_FOR_TARGET'} || "nm";
+
+# Process each symbol.
+open NM,$nm.' -P '.(join ' ',@OBJECTS).'|' or die $!;
+while (<NM>) {
+    my $i;
+    chomp;
+
+    # nm prints out stuff at the start, ignore it.
+    next if (/^$/);
+    next if (/:$/);
+    # Ignore register (SPARC only), undefined and local symbols.  The
+    # symbol name is optional; Sun nm emits none for local or .bss symbols.
+    next if (/^([^ ]+)?[ \t]+[RUa-z][ \t]+ /);
+    # Ignore objects without symbol table.  Message goes to stdout with Sun
+    # nm, while GNU nm emits the corresponding message to stderr.
+    next if (/.* - No symbol table data/);
+
+    # $sym is the name of the symbol.
+    die "unknown nm output $_" if (! /^([^ ]+)[ \t]+[A-Z][ \t]+/);
+    my $sym = $1;
+
+    # Remember symbol.
+    $sym_hash{$sym}++;
+}
+close NM or die "nm error";
+
+##########
+# The various types of glob patterns.
+#
+# A glob pattern that is to be applied to the demangled name: 'cxx'.
+# A glob patterns that applies directly to the name in the .o files: 'glob'.
+# This pattern is ignored; used for local variables (usually just '*'): 'ign'.
+
+# The type of the current pattern.
+my $glob = 'glob';
+
+# We're currently inside `extern "C++"', which Sun ld doesn't understand.
+my $in_extern = 0;
+
+# We're currently inside a conditional section: just skip it.
+my $in_ifdef = 0;
+
+# The c++filt command to use.  This *must* be GNU c++filt; the Sun Studio
+# c++filt doesn't handle the GNU mangling style.
+my $cxxfilt = $ENV{'CXXFILT'} || "c++filt";
+
+# The current version name.
+my $current_version = "";
+
+# Was there any attempt to match a symbol to this version?
+my $matches_attempted;
+
+# The number of versions which matched this symbol.
+my $matched_symbols;
+
+open F,$symvers or die $!;
+
+# Print information about generating this file
+print "# This file was generated by make_sunver.pl.  DO NOT EDIT!\n";
+print "# It was generated by:\n";
+printf "# %s %s %s\n", $0, $symvers, (join ' ',@ARGV);
+printf "# Omitted archives with corresponding shared libraries: %s\n",
+    (join ' ', @SHAREDOBJS) if $#SHAREDOBJS >= 0;
+print "#\n\n";
+
+while (<F>) {
+    # End of skipped section.
+    if (/^[ \t]*\#endif/) {
+	$in_ifdef = 0;
+	next;
+    }
+
+    # Just skip a conditional section.
+    if ($in_ifdef) { next; }
+
+    # Lines of the form '};'
+    if (/^([ \t]*)(\}[ \t]*;[ \t]*)$/) {
+	$glob = 'glob';
+	if ($in_extern) {
+	    $in_extern--;
+	    print "$1##$2";
+	} else {
+	    print;
+	}
+	next;
+    }
+
+    # Lines of the form '} SOME_VERSION_NAME_1.0;'
+    if (/^[ \t]*\}[ \tA-Z0-9_.a-z]+;[ \t]*$/) {
+	$glob = 'glob';
+	# We tried to match symbols agains this version, but none matched.
+	# Emit dummy hidden symbol to avoid marking this version WEAK.
+	if ($matches_attempted && $matched_symbols == 0) {
+	    print "  hidden:\n";
+	    print "    .force_WEAK_off_$current_version = DATA S0x0 V0x0;\n";
+	}
+	print; next;
+    }
+
+    # Special comments that look like C preprocessor conditionals.
+    # Just skip the contents for now.
+    # FIXME: Allow passing in conditionals from the command line to really
+    # control the skipping.
+    if (/^[ \t]*\#ifdef/) {
+	$in_ifdef = 1;
+	next;
+    }
+
+    # Comment and blank lines
+    if (/^[ \t]*\#/) { print; next; }
+    if (/^[ \t]*$/) { print; next; }
+
+    # Lines of the form '{'
+    if (/^([ \t]*){$/) {
+	if ($in_extern) {
+	    print "$1##{\n";
+	} else {
+	    print;
+	}
+	next;
+    }
+
+    # Lines of the form 'SOME_VERSION_NAME_1.1 {'
+    if (/^([A-Z0-9_.]+)[ \t]+{$/) {
+	# Record version name.
+	$current_version = $1;
+	# Reset match attempts, #matched symbols for this version.
+	$matches_attempted = 0;
+	$matched_symbols = 0;
+	print;
+	next;
+    }
+
+    # Ignore 'global:'
+    if (/^[ \t]*global:$/) { print; next; }
+
+    # After 'local:', globs should be ignored, they won't be exported.
+    if (/^[ \t]*local:$/) {
+	$glob = 'ign';
+	print;
+	next;
+    }
+
+    # After 'extern "C++"', globs are C++ patterns
+    if (/^([ \t]*)(extern \"C\+\+\"[ \t]*)$/) {
+	$in_extern++;
+	$glob = 'cxx';
+	# Need to comment, Sun ld cannot handle this.
+	print "$1##$2\n"; next;
+    }
+
+    # Chomp newline now we're done with passing through the input file.
+    chomp;
+
+    # Catch globs.  Note that '{}' is not allowed in globs by this script,
+    # so only '*' and '[]' are available.
+    if (/^([ \t]*)([^ \t;{}#]+);?[ \t]*$/) {
+	my $ws = $1;
+	my $ptn = $2;
+	# Turn the glob into a regex by replacing '*' with '.*'.
+	# Keep $ptn so we can still print the original form.
+	($pattern = $ptn) =~ s/\*/\.\*/g;
+
+	if ($glob eq 'ign') {
+	    # We're in a local: * section; just continue.
+	    print "$_\n";
+	    next;
+	}
+
+	# Print the glob commented for human readers.
+	print "$ws##$ptn ($glob)\n";
+	# We tried to match a symbol to this version.
+	$matches_attempted++;
+
+	if ($glob eq 'glob') {
+	    my %ptn_syms = ();
+
+	    # Match ptn against symbols in %sym_hash.
+	    foreach my $sym (keys %sym_hash) {
+		# Maybe it matches one of the patterns based on the symbol in
+		# the .o file.
+		$ptn_syms{$sym}++ if ($sym =~ /^$pattern$/);
+	    }
+
+	    foreach my $sym (sort keys(%ptn_syms)) {
+		$matched_symbols++;
+		print "$ws$sym;\n";
+	    }
+	} elsif ($glob eq 'cxx') {
+	    my %dem_syms = ();
+
+	    # Verify that we're actually using GNU c++filt.  Other versions
+	    # most likely cannot handle GNU style symbol mangling.
+	    my $cxxout = `$cxxfilt --version 2>&1`;
+	    $cxxout =~ m/GNU/ or die "$0 requires GNU c++filt to function";
+
+	    # Talk to c++filt through a pair of file descriptors.
+	    # Need to start a fresh instance per pattern, otherwise the
+	    # process grows to 500+ MB.
+	    my $pid = open2(*FILTIN, *FILTOUT, $cxxfilt) or die $!;
+
+	    # Match ptn against symbols in %sym_hash.
+	    foreach my $sym (keys %sym_hash) {
+		# No?  Well, maybe its demangled form matches one of those
+		# patterns.
+		printf FILTOUT "%s\n",$sym;
+		my $dem = <FILTIN>;
+		chomp $dem;
+		$dem_syms{$sym}++ if ($dem =~ /^$pattern$/);
+	    }
+
+	    close FILTOUT or die "c++filt error";
+	    close FILTIN or die "c++filt error";
+	    # Need to wait for the c++filt process to avoid lots of zombies.
+	    waitpid $pid, 0;
+
+	    foreach my $sym (sort keys(%dem_syms)) {
+		$matched_symbols++;
+		print "$ws$sym;\n";
+	    }
+	} else {
+	    # No?  Well, then ignore it.
+	}
+	next;
+    }
+    # Important sanity check.  This script can't handle lots of formats
+    # that GNU ld can, so be sure to error out if one is seen!
+    die "strange line `$_'";
+}
+close F;
diff -r 54407e53229c gcc/doc/install.texi
--- a/gcc/doc/install.texi	Mon Jun 28 10:31:36 2010 +0200
+++ b/gcc/doc/install.texi	Mon Jun 28 10:36:05 2010 +0200
@@ -456,8 +456,13 @@
 Necessary when regenerating @file{Makefile} dependencies in libiberty.
 Necessary when regenerating @file{libiberty/functions.texi}.
 Necessary when generating manpages from Texinfo manuals.
-Necessary when targetting Darwin, building libstdc++,
+Necessary when targetting Darwin, building @samp{libstdc++},
 and not using @option{--disable-symvers}.
+Necessary when targetting Solaris 2 with Sun @command{ld}, building
+@samp{libstdc++}, and not using @option{--disable-symvers}.  A helper
+scripts needs @samp{Glob.pm}, which is missing from @command{perl} 5.005
+included in Solaris~8.  The bundled @command{perl} in Solaris~9 and up
+works.
 Used by various scripts to generate some files included in SVN (mainly
 Unicode-related and rarely changing) from source tables.
 
@@ -4131,6 +4136,12 @@
 version (2.20.1) is known to work, but generally lacks platform specific
 features, so better stay with Sun @command{ld}.
 
+To enable symbol versioning in @samp{libstdc++} with Sun @command{ld},
+you need to have any version of GNU @command{c++filt}, which is part of
+GNU binutils.  @samp{libstdc++} symbol versioning will be disabled if no
+appropriate version is found.  Sun @command{c++filt} from the Sun Studio
+compilers does @emph{not} work.
+
 Sun bug 4296832 turns up when compiling X11 headers with GCC 2.95 or
 newer: @command{g++} will complain that types are missing.  These headers
 assume that omitting the type means @code{int}; this assumption worked for
diff -r 54407e53229c libstdc++-v3/acinclude.m4
--- a/libstdc++-v3/acinclude.m4	Mon Jun 28 10:31:36 2010 +0200
+++ b/libstdc++-v3/acinclude.m4	Mon Jun 28 10:36:05 2010 +0200
@@ -2812,11 +2812,14 @@
 
 GLIBCXX_ENABLE(symvers,$1,[=STYLE],
   [enables symbol versioning of the shared library],
-  [permit yes|no|gnu|gnu-versioned-namespace|darwin|darwin-export])
+  [permit yes|no|gnu|gnu-versioned-namespace|darwin|darwin-export|sun])
 
 # If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
 # don't know enough about $LD to do tricks...
 AC_REQUIRE([GLIBCXX_CHECK_LINKER_FEATURES])
+# Sun style symbol versions needs GNU c++filt for make_sunver.pl to work
+# with extern "C++" in version scripts.
+AC_REQUIRE([GCC_PROG_GNU_CXXFILT])
 
 # Turn a 'yes' into a suitable default.
 if test x$enable_symvers = xyes ; then
@@ -2834,6 +2837,20 @@
       case ${target_os} in
         darwin*)
 	  enable_symvers=darwin ;;
+	# Sun symbol versioning exists since Solaris 2.5.
+	solaris2.[[5-9]]* | solaris2.1[[0-9]]*)
+	  # make_sunver.pl needs GNU c++filt to support extern "C++" in
+	  # version scripts, so disable symbol versioning if none can be
+	  # found.
+	  if test -z "$ac_cv_path_CXXFILT"; then
+	    AC_MSG_WARN([=== You have requested Sun symbol versioning, but])
+	    AC_MSG_WARN([=== no GNU c++filt could  be found.])
+	    AC_MSG_WARN([=== Symbol versioning will be disabled.])
+	    enable_symvers=no
+	  else
+	    enable_symvers=sun
+	  fi
+	  ;;
         *)
           enable_symvers=no ;;
       esac
@@ -2846,8 +2863,26 @@
     enable_symvers=darwin
 fi
 
+# Check if 'sun' was requested on non-Solaris 2 platforms.
+if test x$enable_symvers = xsun ; then
+  case ${target_os} in
+    solaris2*)
+      # All fine.
+      ;;
+    *)
+      # Unlikely to work.
+      AC_MSG_WARN([=== You have requested Sun symbol versioning, but])
+      AC_MSG_WARN([=== you are not targetting Solaris 2.])
+      AC_MSG_WARN([=== Symbol versioning will be disabled.])
+      enable_symvers=no
+      ;;
+  esac
+fi
+
 # Check to see if 'gnu' can win.
-if test $enable_symvers = gnu || test $enable_symvers = gnu-versioned-namespace; then
+if test $enable_symvers = gnu || 
+  test $enable_symvers = gnu-versioned-namespace || 
+  test $enable_symvers = sun; then
   # Check to see if libgcc_s exists, indicating that shared libgcc is possible.
   AC_MSG_CHECKING([for shared libgcc])
   ac_save_CFLAGS="$CFLAGS"
@@ -2883,6 +2918,8 @@
       AC_MSG_WARN([=== you are not building a shared libgcc_s.])
       AC_MSG_WARN([=== Symbol versioning will be disabled.])
       enable_symvers=no
+  elif test $with_gnu_ld != yes && test $enable_symvers = sun; then
+    : All interesting versions of Sun ld support sun style symbol versioning.
   elif test $with_gnu_ld != yes ; then
     # just fail for now
     AC_MSG_WARN([=== You have requested GNU symbol versioning, but])
@@ -2922,6 +2959,11 @@
     AC_DEFINE(_GLIBCXX_SYMVER_DARWIN, 1, 
               [Define to use darwin versioning in the shared library.])
     ;;
+  sun)
+    SYMVER_FILE=config/abi/pre/gnu.ver
+    AC_DEFINE(_GLIBCXX_SYMVER_SUN, 1, 
+              [Define to use Sun versioning in the shared library.])
+    ;;
 esac
 
 if test x$enable_symvers != xno ; then
@@ -2945,8 +2987,24 @@
 GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_GNU, test $enable_symvers = gnu)
 GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_GNU_NAMESPACE, test $enable_symvers = gnu-versioned-namespace)
 GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_DARWIN, test $enable_symvers = darwin)
+GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_SUN, test $enable_symvers = sun)
 AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
 
+if test $enable_symvers != no ; then
+   case ${target_os} in
+     # The Solaris 2 runtime linker doesn't support the GNU extension of
+     # binding the same symbol to different versions
+     solaris2*)
+       symvers_renaming=no  ;;
+     # Other platforms with GNU symbol versioning (GNU/Linux, more?) do.
+     *)
+       AC_DEFINE(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT, 1,
+         [Define to 1 if the target runtime linker supports binding the same symbol to different versions.])
+       symvers_renaming=yes
+    esac
+fi
+GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_SOL2, test $symvers_renaming = no)
+
 # Now, set up compatibility support, if any.
 # In addition, need this to deal with std::size_t mangling in
 # src/compatibility.cc.  In a perfect world, could use
@@ -3083,5 +3141,6 @@
 ])
 
 # Macros from the top-level gcc directory.
+m4_include([../config/gc++filt.m4])
 m4_include([../config/tls.m4])
 
diff -r 54407e53229c libstdc++-v3/config/abi/pre/gnu.ver
--- a/libstdc++-v3/config/abi/pre/gnu.ver	Mon Jun 28 10:31:36 2010 +0200
+++ b/libstdc++-v3/config/abi/pre/gnu.ver	Mon Jun 28 10:36:05 2010 +0200
@@ -740,6 +740,7 @@
     sqrtl;
     copysignf;
 
+#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
    # GLIBCXX_ABI compatibility only.
     # std::string
     _ZNKSs11_M_disjunctEPKc;
@@ -767,6 +768,7 @@
     _ZNSt11char_traitsI[cw]E2eqERK[cw]S2_;
 
     _ZNSt19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEppEv;
+#endif
 
     # std::locale::Impl _M_ members
     _ZNSt6locale5_Impl16_M_install_facetEPKNS_2idEPKNS_5facetE;
@@ -875,7 +877,9 @@
 
     _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE9showmanycEv;
 
+#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
     _ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv;
+#endif
 
     _ZN9__gnu_cxx6__poolILb1EE13_M_initializeEv;
 
diff -r 54407e53229c libstdc++-v3/configure.host
--- a/libstdc++-v3/configure.host	Mon Jun 28 10:31:36 2010 +0200
+++ b/libstdc++-v3/configure.host	Mon Jun 28 10:36:05 2010 +0200
@@ -320,7 +320,13 @@
 	;;
     esac
     ;;
+  i?86-*-solaris2*)
+    abi_baseline_pair=i386-solaris2
+    ;;
   powerpc*-*-darwin*)
     port_specific_symbol_files="\$(srcdir)/../config/os/bsd/darwin/ppc-extra.ver"
     ;;
+  sparc*-*-solaris2*)
+    abi_baseline_pair=sparc-solaris2
+    ;;
 esac
diff -r 54407e53229c libstdc++-v3/doc/xml/manual/abi.xml
--- a/libstdc++-v3/doc/xml/manual/abi.xml	Mon Jun 28 10:31:36 2010 +0200
+++ b/libstdc++-v3/doc/xml/manual/abi.xml	Mon Jun 28 10:36:05 2010 +0200
@@ -33,9 +33,9 @@
 <title>The C++ Interface</title>
 
 <para>
-  C++ applications often dependent on specific language support
+  C++ applications often depend on specific language support
   routines, say for throwing exceptions, or catching exceptions, and
-  perhaps also dependent on features in the C++ Standard Library.
+  perhaps also depend on features in the C++ Standard Library.
 </para>
 
 <para>
@@ -122,7 +122,7 @@
 releases of library binaries the ability to add new symbols and add
 functionality, all the while retaining compatibility with the previous
 releases in the series. Thus, program binaries linked with the initial
-release of a library binary will still link correctly if the library
+release of a library binary will still run correctly if the library
 binary is replaced by carefully-managed subsequent library
 binaries. This is called forward compatibility.
 </para>
@@ -232,7 +232,7 @@
     <listitem>
       <para>
 	Release versioning on the libstdc++.so binary, implemented in
-	the same was as the libgcc_s.so binary above. Listed is the
+	the same way as the libgcc_s.so binary above. Listed is the
 	filename: <constant>DT_SONAME</constant> can be deduced from
 	the filename by removing the last two period-delimited numbers. For
 	example, filename <filename>libstdc++.so.5.0.4</filename>
@@ -306,10 +306,10 @@
 
     <listitem><para>Symbol versioning on the libstdc++.so binary.</para>
 
-    <para>mapfile: libstdc++/config/linker-map.gnu</para>
+    <para>mapfile: libstdc++-v3/config/abi/pre/gnu.ver</para>
     <para>It is versioned with the following labels and version
    definitions, where the version definition is the maximum for a
-   particular release. Note, only symbol which are newly introduced
+   particular release. Note, only symbols which are newly introduced
    will use the maximum version definition. Thus, for release series
    with the same label, but incremented version definitions, the later
    release has both versions. (An example of this would be the
@@ -410,7 +410,7 @@
 
     <para>
     This macro is defined in the file "c++config" in the
-    "libstdc++/include/bits" directory. (Up to gcc-4.1.0, it was
+    "libstdc++-v3/include/bits" directory. (Up to gcc-4.1.0, it was
     changed every night by an automated script. Since gcc-4.1.0, it is
     the same value as gcc/DATESTAMP.)
     </para>
@@ -474,7 +474,7 @@
 
     <para>
     This macro is defined in the file "c++config" in the
-    "libstdc++/include/bits" directory and is generated
+    "libstdc++-v3/include/bits" directory and is generated
     automatically by autoconf as part of the configure-time generation
     of config.h.
     </para>
@@ -514,7 +514,7 @@
     All C++ includes are installed in include/c++, then nest in a
     directory hierarchy corresponding to the C++ compiler's released
     version. This version corresponds to the variable "gcc_version" in
-    "libstdc++/acinclude.m4," and more details can be found in that
+    "libstdc++-v3/acinclude.m4," and more details can be found in that
     file's macro GLIBCXX_CONFIGURE (GLIBCPP_CONFIGURE before gcc-3.4.0).
     </para>
     <para>
@@ -584,7 +584,8 @@
     <para>
       Minimum environment that supports a versioned ABI: A supported
       dynamic linker, a GNU linker of sufficient vintage to understand
-      demangled C++ name globbing (ld), a shared executable compiled
+      demangled C++ name globbing (ld) or the Sun linker, a shared
+      executable compiled
       with g++, and shared libraries (libgcc_s, libstdc++) compiled by
       a compiler (g++) with a compatible ABI. Phew.
     </para>
@@ -598,7 +599,7 @@
     <para>
       Most modern Linux and BSD versions, particularly ones using
       gcc-3.1.x tools and more recent vintages, will meet the
-      requirements above.
+      requirements above, as does Solaris 2.5 and up.
     </para>
   </sect3>
 
@@ -614,7 +615,7 @@
     <para>
       For more information on configure options, including ABI
       impacts, see:
-      http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html
+      <link linkend="manual.intro.setup.configure">here</link>
     </para>
 
     <para>
@@ -623,7 +624,7 @@
     </para>
 
     <para>
-      In particular, libstdc++/acinclude.m4 has a macro called
+      In particular, libstdc++-v3/acinclude.m4 has a macro called
       GLIBCXX_ENABLE_SYMVERS that defaults to yes (or the argument
       passed in via --enable-symvers=foo). At that point, the macro
       attempts to make sure that all the requirement for symbol
@@ -648,6 +649,7 @@
 </screen>
 
 <para>
+  or another of the supported styles.
   If you don't see this line in the configure output, or if this line
   appears but the last word is 'no', then you are out of luck.
 </para>
@@ -685,6 +687,23 @@
    <code>U _ZNSt8ios_base4InitC1Ev@@GLIBCXX_3.4</code>
 </para>
 
+<para>
+On Solaris 2, you can use <code>pvs -r</code> instead:
+</para>
+
+<programlisting>
+%g++ hello.cc -o hello.out
+
+%pvs -r hello.out
+        libstdc++.so.6 (GLIBCXX_3.4, GLIBCXX_3.4.12);
+        libgcc_s.so.1 (GCC_3.0);
+        libc.so.1 (SUNWprivate_1.1, SYSVABI_1.3);
+</programlisting>
+
+<para>
+<code>ldd -v</code> works too, but is very verbose.
+</para>
+
   </sect3>
 </sect2>
 
@@ -735,7 +754,7 @@
 <listitem><para> Adding an explicit copy constructor or destructor to a
 class that would otherwise have implicit versions. This will change
 the way the compiler deals with this class in by-value return
-statements or parameters: instead of being passing instances of this
+statements or parameters: instead of passing instances of this
 class in registers, the compiler will be forced to use memory. See <ulink url="http://www.codesourcery.com/cxx-abi/abi.html#calls"> this part</ulink>
  of the C++ ABI documentation for further details.
  </para></listitem>
@@ -920,7 +939,7 @@
 </para>
 
 <para>
-This is a proactive check the library ABI. Currently, exported symbol
+This is a proactive check of the library ABI. Currently, exported symbol
 names that are either weak or defined are checked against a last known
 good baseline. Currently, this baseline is keyed off of 3.4.0
 binaries, as this was the last time the .so number was incremented. In
@@ -955,7 +974,7 @@
 get information. However, currently this approach gives insufficient
 data for use in library testing, as class data members, their offsets,
 and other detailed data is not displayed with this flag.
-(See g++/7470 on how this was used to find bugs.)
+(See PR g++/7470 on how this was used to find bugs.)
 </para>
 
 <para>
@@ -968,7 +987,7 @@
     <title>Multiple ABI Testing</title>
 <para>
 A "C" application, dynamically linked to two shared libraries, liba,
-libb. The dependent library liba is C++ shared library compiled with
+libb. The dependent library liba is a C++ shared library compiled with
 gcc-3.3.x, and uses io, exceptions, locale, etc. The dependent library
 libb is a C++ shared library compiled with gcc-3.4.x, and also uses io,
 exceptions, locale, etc.
@@ -1114,9 +1133,9 @@
 
   <biblioentry>
     <biblioid class="uri">
-      <ulink url="http://docs.sun.com/app/docs/doc/817-1984">
+      <ulink url="http://docs.sun.com/app/docs/doc/819-0690">
 	<citetitle>
-	  Sun Solaris 2.9 : Linker and Libraries Guide (document 816-1386)
+	  Linker and Libraries Guide (document 819-0690)
 	</citetitle>
       </ulink>
     </biblioid>
@@ -1125,9 +1144,9 @@
 
   <biblioentry>
     <biblioid class="uri">
-      <ulink url="http://docs.sun.com/app/docs/doc/819-5266">
+      <ulink url="http://docs.sun.com/app/docs/doc/819-3689">
 	<citetitle>
-	  Sun Solaris 2.9 : C++ Migration Guide (document 816-2459)
+	  Sun Studio 11: C++ Migration Guide (document 819-3689)
 	</citetitle>
       </ulink>
     </biblioid>
diff -r 54407e53229c libstdc++-v3/doc/xml/manual/configure.xml
--- a/libstdc++-v3/doc/xml/manual/configure.xml	Mon Jun 28 10:31:36 2010 +0200
+++ b/libstdc++-v3/doc/xml/manual/configure.xml	Mon Jun 28 10:36:05 2010 +0200
@@ -279,8 +279,8 @@
  <listitem><para>In 3.1 and later, tries to turn on symbol versioning in the
 	shared library (if a shared library has been
 	requested). Values for 'style' that are currently supported
-	are 'gnu', 'gnu-versioned-namespace', 'darwin', and
-	'darwin-export'. Both gnu- options require that a recent
+	are 'gnu', 'gnu-versioned-namespace', 'darwin',
+	'darwin-export', and 'sun'. Both gnu- options require that a recent
 	version of the GNU linker be in use. Both darwin options are
 	equivalent. With no style given, the configure script will try
 	to guess correct defaults for the host system, probe to see if
diff -r 54407e53229c libstdc++-v3/src/Makefile.am
--- a/libstdc++-v3/src/Makefile.am	Mon Jun 28 10:31:36 2010 +0200
+++ b/libstdc++-v3/src/Makefile.am	Mon Jun 28 10:36:05 2010 +0200
@@ -45,14 +45,38 @@
 	  fi; \
 	fi
 
+CLEANFILES = libstdc++-symbols.ver
+
 if ENABLE_SYMVERS_GNU
+if ENABLE_SYMVERS_SOL2
+version_arg = -Wl,--version-script,libstdc++-symbols.ver-sol2
+version_dep = libstdc++-symbols.ver-sol2
+libstdc++-symbols.ver-sol2 : libstdc++-symbols.ver
+	sed -e '/^#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT/,/^#endif/d' $< \
+	 > $@ || (rm -f $@ ; exit 1)
+else
 version_arg = -Wl,--version-script=libstdc++-symbols.ver
 version_dep = libstdc++-symbols.ver
 endif
+endif
 if ENABLE_SYMVERS_GNU_NAMESPACE
 version_arg = -Wl,--version-script=libstdc++-symbols.ver
 version_dep = libstdc++-symbols.ver
 endif
+if ENABLE_SYMVERS_SUN
+version_arg = -Wl,-M,libstdc++-symbols.ver-sun
+version_dep = libstdc++-symbols.ver-sun
+libstdc++-symbols.ver-sun : libstdc++-symbols.ver \
+		$(toplevel_srcdir)/contrib/make_sunver.pl \
+		$(libstdc___la_OBJECTS) $(libstdc___la_LIBADD)
+	CXXFILT="$(CXXFILT)"; export CXXFILT; \
+	perl $(toplevel_srcdir)/contrib/make_sunver.pl \
+	  libstdc++-symbols.ver \
+	  $(libstdc___la_OBJECTS:%.lo=.libs/%.o) \
+	 `echo $(libstdc___la_LIBADD) | \
+	    sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+	 > $@ || (rm -f $@ ; exit 1)
+endif
 if ENABLE_SYMVERS_DARWIN
 version_arg = -Wl,-exported_symbols_list,libstdc++-symbols.explist
 version_dep = libstdc++-symbols.explist
@@ -66,6 +90,8 @@
 	    sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
 	 > $@ || (rm -f $@ ; exit 1)
 endif
+
+CLEANFILES += $(version_dep)
 else
 version_arg =
 version_dep =
diff -r 54407e53229c libstdc++-v3/src/atomic.cc
--- a/libstdc++-v3/src/atomic.cc	Mon Jun 28 10:31:36 2010 +0200
+++ b/libstdc++-v3/src/atomic.cc	Mon Jun 28 10:36:05 2010 +0200
@@ -1,6 +1,6 @@
 // Support for atomic operations -*- C++ -*-
 
-// Copyright (C) 2008, 2009
+// Copyright (C) 2008, 2009, 2010
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -127,7 +127,8 @@
 // _GLIBCXX_*_SYMVER macros in this file.
 
 #if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \
-    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
+    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \
+    && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
 
 #define _GLIBCXX_ASM_SYMVER(cur, old, version) \
    asm (".symver " #cur "," #old "@@" #version);
diff -r 54407e53229c libstdc++-v3/src/compatibility.cc
--- a/libstdc++-v3/src/compatibility.cc	Mon Jun 28 10:31:36 2010 +0200
+++ b/libstdc++-v3/src/compatibility.cc	Mon Jun 28 10:36:05 2010 +0200
@@ -26,7 +26,8 @@
 #include <bits/c++config.h>
 
 #if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \
-    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
+    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)\
+    && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
 #define istreambuf_iterator istreambuf_iteratorXX
 #define basic_fstream basic_fstreamXX
 #define basic_ifstream basic_ifstreamXX
@@ -201,7 +202,8 @@
 // NB: These symbols renames should go into the shared library only,
 // and only those shared libraries that support versioning.
 #if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \
-    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
+    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \
+    && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
 
 /* gcc-3.4.4
 _ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv
diff -r 54407e53229c libstdc++-v3/testsuite/Makefile.am
--- a/libstdc++-v3/testsuite/Makefile.am	Mon Jun 28 10:31:36 2010 +0200
+++ b/libstdc++-v3/testsuite/Makefile.am	Mon Jun 28 10:36:05 2010 +0200
@@ -69,8 +69,10 @@
 
 extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
 
+baseline_subdir := $(shell $(CXX) --print-multi-dir)
+
 baseline_symbols:
-	-@(output=${baseline_dir}/baseline_symbols.txt; \
+	-@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \
 	  if test ! -f $${output}; then \
 	    echo "Baseline file doesn't exist."; \
 	    echo "Try 'make new-abi-baseline' to create it."; \
@@ -78,8 +80,8 @@
 	  fi; true)
 
 new-abi-baseline:
-	-@$(mkinstalldirs) ${baseline_dir}
-	-@(output=${baseline_dir}/baseline_symbols.txt; \
+	-@$(mkinstalldirs) ${baseline_dir}/${baseline_subdir}
+	-@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \
 	  if test -f $${output}; then \
 	    output=$${output}.new; \
 	    t=`echo $${output} | sed 's=.*config/abi/=='`; \
