This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Ambiguities in version script
- From: Ian Lance Taylor <iant at google dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Fri, 08 Jan 2010 22:52:36 -0800
- Subject: 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