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] Ignore elfdump warnings in scripts/extract_symvers.pl


The libstdc++-v3 abi_check test is FAILing on Solaris 11 with gld.  It
turns out this happens because a elfdump warning (printed to stderr) is
mixed with regular elfdump output.  In the case at hand, elfdump warns

 .gnu.version_r: zero sh_entsize information, expected 0x1
 .gnu.version_d: zero sh_entsize information, expected 0x1

but obviously trying to parse warnings as regular output is doomed to
fail.  While it has been determined that those concrete warnings are
bogus and will be removed in the future, the general problem remains.
The following patch fixes this by just ignoring elfdump error output.

Bootstrapped without regressions on i386-pc-solaris2.1[01] and
sparc-sun-solaris2.1[01] (with as/ld, gas/gld) on both mainline and
gcc-5 branch.  Ok for mainline and gcc-5 branch?  I suppose the patch is
safe enough even at this point since it only affects a solaris specific
file.

	Rainer


2015-04-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* scripts/extract_symvers.pl: Ignore elfdump error output.

# HG changeset patch
# Parent 8093370756d009b628285d00fd7c4513d91fea92
Ignore elfdump warnings in scripts/extract_symvers.pl

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
@@ -82,7 +82,10 @@ while (<PVS>) {
 close PVS or die "pvs error";
 
 # Only look at .dynsym table, like readelf in extract_symvers.
-open ELFDUMP, "/usr/ccs/bin/elfdump -s -N .dynsym $lib |" or die $!;
+# Ignore error output to avoid getting confused by
+# .gnu.version_r: zero sh_entsize information, expected 0x1
+# warning with Solaris 11 elfdump on gld-produced shared objects.
+open ELFDUMP, "/usr/ccs/bin/elfdump -s -N .dynsym $lib 2>/dev/null |" or die $!;
 while (<ELFDUMP>) {
     chomp;
 
-- 
-----------------------------------------------------------------------------
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]