[committed] libstdc++: Fix symbol versioning for Solaris 11.3 [PR103407]

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Fri Mar 18 12:47:37 GMT 2022


Hi Jonathan,

> I did some very brief testing and it seemed like a program linked to
> the Solaris 11.3 libstdc++.so.6.0.30 (with from_chars@GLIBCXX_3.4.30)
> can still run against libstdc++.so.6.0.30 with
> from_chars@GLIBCXX_3.4.29 (which should match what you get on Solaris
> 11.4 if I correctly fiddled with the versioning). So I don't

indeed.  You can observe the symbols provided and consumed by shared
objects and executables with pvs.

E.g. on 11.4:

$ pvs -dsvo libstdc++.so|grep _ZSt10from_charsPKcS0_R
libstdc++.so -	GLIBCXX_3.4.29: _ZSt10from_charsPKcS0_RfSt12chars_format;
libstdc++.so -	GLIBCXX_3.4.29: _ZSt10from_charsPKcS0_ReSt12chars_format;
libstdc++.so -	GLIBCXX_3.4.29: _ZSt10from_charsPKcS0_RdSt12chars_format;

for the provider side vs. 11.3:

$ pvs -dsvo libstdc++.so|grep _ZSt10from_charsPKcS0_R
libstdc++.so -	GLIBCXX_3.4.30: _ZSt10from_charsPKcS0_ReSt12chars_format;
libstdc++.so -	GLIBCXX_3.4.30: _ZSt10from_charsPKcS0_RdSt12chars_format;
libstdc++.so -	GLIBCXX_3.4.30: _ZSt10from_charsPKcS0_RfSt12chars_format;

pvs -r shows symbols and versions required by an executable.

> understand how the Solaris runtime linker handles symbol versions, but
> it seems like there's no backwards compatibility problem for the
> Solaris 11.4 build of libstdc++.so.6.0.30.

You can observe this at runtime with LD_DEBUG=versions or
versions,detail.  LD_DEBUG=help <some command> gives the full info.

IIRC Solaris ld.so.1 just checks if the versions required by an
executable are provided by a shared object, but doesn't look into
individual symbols in advance.  It may well be that some checks have
been relaxed in the 11.4 timeframe, though.

	Rainer

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


More information about the Libstdc++ mailing list