Bruno Haible <br...@clisp.org> writes: > Simon Josefsson wrote: >> The version script file is documented in the LD manual, but a short >> example would be: >> >> SHISHI_0.0 { >> global: >> shishi*; >> >> local: >> *; >> }; > > Could you please explain what the entire thing is about? Is it about > hiding some symbols from "nm libshishi.so", for which gcc offers a solution > at source code level (see [1] and gnulib's m4/visibility.m4)?
No, that's not the primary motivation, but it is a useful side-effect. If it didn't have that side-effect, hiding the symbols would need to be done in some other way. > Or is it about allowing multiple versions of the same symbol to exist > in the same shared library, something which is supported only by glibc > and Solaris [2]? Yes, that is one reason. > I'm asking because linker scripts only work with GNU ld (I guess). Yes, I think so. Further, shared library versioning can be useful when maintaining packages in GNU/Linux distributions, and it seems people in Debian prefers that shared libraries always use versioning. See for example: http://article.gmane.org/gmane.comp.gnu.gss.general/139 Of course a good reference where this is discussed is: http://people.redhat.com/drepper/dsohowto.pdf /Simon