This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Ambiguities in version script


I've modified the gold linker to warn when it looks up a symbol in a
version script and finds an ambiguity.  When I build libstdc++-v3 on
i686-pc-linux-gnu, I find three problems:

/home/iant/binutils/gold-dir/ld: error: '_ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv' has multiple versions in version script
/home/iant/binutils/gold-dir/ld: error: '_ZNKSs11_M_disjunctEPKc' has multiple versions in version script
/home/iant/binutils/gold-dir/ld: error: '_ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw' has multiple versions in version script'


_ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv is defined in
sstream-inst.o.  The version script lists it in both GLIBCXX_3.4 and
GLIBCXX_3.4.6.  This seems like a bug.

_ZNKSs11_M_disjunctEPKc is defined in string-inst.o.  The version
script lists it in both GLIBCXX_3.4 and GLIBCXX_3.4.5.  It is also
defined, with versions, in compatibility.o.  There is arguably no real
bug here, as the default version from compatibility.o should wind up
overriding the symbol defined in string-inst.o.  gold currently gives
the error when trying to decide which version to use for the unadorned
symbol in string-inst.o.

_ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw is similar, except
that the unadorned version is defined in wstring-inst.o.

I think it is somewhat confusing to list a symbol under two different
versions in a version script in cases where the symbol appears in an
object file without a symver directive.  It's not clear which version
to use.  That is why gold issues the error.

Does anybody want to argue that it is a good idea for the version
script to work this way?  Or should I send in a patch to change it?

Thanks.

Ian


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