How should STB_GNU_UNIQUE binding interact with RTLD_LOCAL ?
Cary Coutant
ccoutant@google.com
Fri Oct 28 21:21:00 GMT 2011
> http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01240.html is the earliest
> thing I've found quickly that talks about the rationale. If you think the
> rationale is bogus, then you should take it up with Jason. Since I'm
> curious, you can CC: me. But I don't think libc-alpha needs to hear all
> that discussion. We're just supporting what the C++ gurus have said they
> need, and all we need to hear about here is if the consensus of C++ gurus
> changes.
For the case discussed in that email (a common library that two others
both depend on), I think the basic idea is sound. The problem is that
when the two separately-loaded libraries (i.e., the ones that both
depend on the common library) define the same symbol, that symbol is
also shared between the two libraries. That, along with the fact that
some symbols get STB_GNU_UNIQUE binding (e.g., statics in template
instantiations, statics in inlines) and other symbols don't (e.g.,
statics in non-template classes), leads to the issues that we're
seeing.
-cary
More information about the Libc-alpha
mailing list