This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] Filter out basever symbols on Solaris


Currently, the Solaris baselines include several symbols that are not
libstdc++-specific, but are (or should be) present in every Solaris
shared object (like _DYNAMIC, _GLOBAL_OFFSET_TABLE_, and several
others).  Unfortunately, under some circumstances (combination of
assembler and linker used) they may be missing, leading to spurious
abi_check failures that are completely unrelated to the libstdc++.so.6
ABI.  To avoid this, the following patch skips them in
extract_symvers.{pl, in} and drops them from the baselines.

Bootstrapped without regressions on i386-pc-solaris2.{9,10,11},
sparc-sun-solaris2.{9,10,11}, and x86_64-unknown-linux-gnu, fixes the
64-bit abi_check failures on Solaris 10 and 11/x86.

To make sure that the fix to the readelf version is correct, I've run a
version of extract_symvers with the SunOS case removed in a
i386-pc-solaris2.11 build with gas and gld and verified that the output
is identical.

Ok for mainline?

	Rainer


2013-02-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* scripts/extract_symvers.pl: Omit symbols bound to base
	versions.
	* scripts/extract_symvers.in: Likewise.
	* config/abi/post/solaris2.9/baseline_symbols.txt: Regenerate.
	* config/abi/post/solaris2.9/sparcv9/baseline_symbols.txt: Likewise.
	* config/abi/post/solaris2.10/baseline_symbols.txt: Likewise.
	* config/abi/post/solaris2.10/amd64/baseline_symbols.txt: Likewise.
	* config/abi/post/solaris2.10/sparcv9/baseline_symbols.txt: Likewise.

# HG changeset patch
# Parent ba2042b7917dbcad588329f47c3cc0b47d6e7788
Filter out basever symbols on Solaris

diff --git a/libstdc++-v3/config/abi/post/solaris2.10/amd64/baseline_symbols.txt b/libstdc++-v3/config/abi/post/solaris2.10/amd64/baseline_symbols.txt
--- a/libstdc++-v3/config/abi/post/solaris2.10/amd64/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/solaris2.10/amd64/baseline_symbols.txt
@@ -2485,12 +2485,6 @@ OBJECT:0:GLIBCXX_3.4.6
 OBJECT:0:GLIBCXX_3.4.7
 OBJECT:0:GLIBCXX_3.4.8
 OBJECT:0:GLIBCXX_3.4.9
-OBJECT:0:_DYNAMIC
-OBJECT:0:_GLOBAL_OFFSET_TABLE_
-OBJECT:0:_PROCEDURE_LINKAGE_TABLE_
-OBJECT:0:_edata
-OBJECT:0:_end
-OBJECT:0:_etext
 OBJECT:104:_ZTVSt10moneypunctIcLb0EE@@GLIBCXX_3.4
 OBJECT:104:_ZTVSt10moneypunctIcLb1EE@@GLIBCXX_3.4
 OBJECT:104:_ZTVSt10moneypunctIwLb0EE@@GLIBCXX_3.4
diff --git a/libstdc++-v3/config/abi/post/solaris2.10/baseline_symbols.txt b/libstdc++-v3/config/abi/post/solaris2.10/baseline_symbols.txt
--- a/libstdc++-v3/config/abi/post/solaris2.10/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/solaris2.10/baseline_symbols.txt
@@ -2485,12 +2485,6 @@ OBJECT:0:GLIBCXX_3.4.6
 OBJECT:0:GLIBCXX_3.4.7
 OBJECT:0:GLIBCXX_3.4.8
 OBJECT:0:GLIBCXX_3.4.9
-OBJECT:0:_DYNAMIC
-OBJECT:0:_GLOBAL_OFFSET_TABLE_
-OBJECT:0:_PROCEDURE_LINKAGE_TABLE_
-OBJECT:0:_edata
-OBJECT:0:_end
-OBJECT:0:_etext
 OBJECT:1028:_ZNSt3tr18__detail12__prime_listE@@GLIBCXX_3.4.10
 OBJECT:1028:_ZNSt8__detail12__prime_listE@@GLIBCXX_3.4.10
 OBJECT:12:_ZTIN10__cxxabiv116__enum_type_infoE@@CXXABI_1.3
diff --git a/libstdc++-v3/config/abi/post/solaris2.10/sparcv9/baseline_symbols.txt b/libstdc++-v3/config/abi/post/solaris2.10/sparcv9/baseline_symbols.txt
--- a/libstdc++-v3/config/abi/post/solaris2.10/sparcv9/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/solaris2.10/sparcv9/baseline_symbols.txt
@@ -2485,12 +2485,6 @@ OBJECT:0:GLIBCXX_3.4.6
 OBJECT:0:GLIBCXX_3.4.7
 OBJECT:0:GLIBCXX_3.4.8
 OBJECT:0:GLIBCXX_3.4.9
-OBJECT:0:_DYNAMIC
-OBJECT:0:_GLOBAL_OFFSET_TABLE_
-OBJECT:0:_PROCEDURE_LINKAGE_TABLE_
-OBJECT:0:_edata
-OBJECT:0:_end
-OBJECT:0:_etext
 OBJECT:104:_ZTVSt10moneypunctIcLb0EE@@GLIBCXX_3.4
 OBJECT:104:_ZTVSt10moneypunctIcLb1EE@@GLIBCXX_3.4
 OBJECT:104:_ZTVSt10moneypunctIwLb0EE@@GLIBCXX_3.4
diff --git a/libstdc++-v3/config/abi/post/solaris2.9/baseline_symbols.txt b/libstdc++-v3/config/abi/post/solaris2.9/baseline_symbols.txt
--- a/libstdc++-v3/config/abi/post/solaris2.9/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/solaris2.9/baseline_symbols.txt
@@ -2499,12 +2499,6 @@ OBJECT:0:GLIBCXX_3.4.6
 OBJECT:0:GLIBCXX_3.4.7
 OBJECT:0:GLIBCXX_3.4.8
 OBJECT:0:GLIBCXX_3.4.9
-OBJECT:0:_DYNAMIC
-OBJECT:0:_GLOBAL_OFFSET_TABLE_
-OBJECT:0:_PROCEDURE_LINKAGE_TABLE_
-OBJECT:0:_edata
-OBJECT:0:_end
-OBJECT:0:_etext
 OBJECT:1028:_ZNSt3tr18__detail12__prime_listE@@GLIBCXX_3.4.10
 OBJECT:1028:_ZNSt8__detail12__prime_listE@@GLIBCXX_3.4.10
 OBJECT:12:_ZTIN10__cxxabiv116__enum_type_infoE@@CXXABI_1.3
diff --git a/libstdc++-v3/config/abi/post/solaris2.9/sparcv9/baseline_symbols.txt b/libstdc++-v3/config/abi/post/solaris2.9/sparcv9/baseline_symbols.txt
--- a/libstdc++-v3/config/abi/post/solaris2.9/sparcv9/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/solaris2.9/sparcv9/baseline_symbols.txt
@@ -2499,12 +2499,6 @@ OBJECT:0:GLIBCXX_3.4.6
 OBJECT:0:GLIBCXX_3.4.7
 OBJECT:0:GLIBCXX_3.4.8
 OBJECT:0:GLIBCXX_3.4.9
-OBJECT:0:_DYNAMIC
-OBJECT:0:_GLOBAL_OFFSET_TABLE_
-OBJECT:0:_PROCEDURE_LINKAGE_TABLE_
-OBJECT:0:_edata
-OBJECT:0:_end
-OBJECT:0:_etext
 OBJECT:104:_ZTVSt10moneypunctIcLb0EE@@GLIBCXX_3.4
 OBJECT:104:_ZTVSt10moneypunctIcLb1EE@@GLIBCXX_3.4
 OBJECT:104:_ZTVSt10moneypunctIwLb0EE@@GLIBCXX_3.4
diff --git a/libstdc++-v3/scripts/extract_symvers.in b/libstdc++-v3/scripts/extract_symvers.in
--- a/libstdc++-v3/scripts/extract_symvers.in
+++ b/libstdc++-v3/scripts/extract_symvers.in
@@ -49,9 +49,12 @@ SunOS)
   if readelf --help | grep -- --wide > /dev/null; then
     readelf="$readelf --wide"
   fi
+  # Omit _DYNAMIC etc. for consistency with extract_symvers.pl, only
+  # present on Solaris.
   ${readelf} ${lib} |\
   sed -e 's/ \[<other>: [A-Fa-f0-9]*\] //' -e '/\.dynsym/,/^$/p;d' |\
   egrep -v ' (LOCAL|UND) ' |\
+  egrep -v '(_DYNAMIC|_GLOBAL_OFFSET_TABLE_|_PROCEDURE_LINKAGE_TABLE_|_edata|_end|_etext)$' |\
   sed -e 's/ <processor specific>: / <processor_specific>:_/g' |\
   sed -e 's/ <OS specific>: / <OS_specific>:_/g' |\
   sed -e 's/ <unknown>: / <unknown>:_/g' |\
diff --git a/libstdc++-v3/scripts/extract_symvers.pl b/libstdc++-v3/scripts/extract_symvers.pl
--- a/libstdc++-v3/scripts/extract_symvers.pl
+++ b/libstdc++-v3/scripts/extract_symvers.pl
@@ -67,7 +67,11 @@ while (<PVS>) {
     if ($version eq $symbol or $version eq $basever) {
 	# Emit versions or symbols bound to base versions as objects.
 	$type{$symbol} = "OBJECT";
-	$version{$symbol} = $symbol;
+	if ($version eq $basever) {
+	    $version{$symbol} = $version;
+	} else {
+	    $version{$symbol} = $symbol;
+	}
 	$size{$symbol} = 0;
     } else {
 	# Everything else without a size field is a function.
@@ -120,6 +124,10 @@ foreach $symbol (keys %type) {
     if ($type{$symbol} eq "FUNC" || $type{$symbol} eq "NOTYPE") {
 	push @lines, "$type{$symbol}:$symbol\@\@$version{$symbol}\n";
     } elsif ($type{$symbol} eq "OBJECT" and $size{$symbol} == 0) {
+	# Omit symbols bound to base version; details can differ depending
+	# on the toolchain used.
+	next if $version{$symbol} eq $basever;
+
 	push @lines, "$type{$symbol}:$size{$symbol}:$version{$symbol}\n";
     } else {
 	push @lines, "$type{$symbol}:$size{$symbol}:$symbol\@\@$version{$symbol}\n";
-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]