What are the ELF shared lib symbol versioning best practices?

Jakub Jelinek jakub at redhat.com
Tue Oct 21 16:18:26 UTC 2014


On Tue, Oct 21, 2014 at 12:13:19PM -0400, Adam Jackson wrote:
> On Tue, 2014-10-21 at 15:59 +0100, David Howells wrote:
> > Is there a good description of ELF shared library symbol versioning best
> > practices somewhere?
> > 
> > In particular, under what conditions do you need to create a new section in
> > the versioning file given to the linker's --version-script option when new
> > symbols are added?
> 
> Every time you add _any_ new exported symbol to the API.

Every symbol doesn't have to have a new symbol version, it is just fine if
there is just one symbol version per release that added symbols, as long as
the development snapshots in between releases are not significantly
wide-spread/used as stable versions.  On stable branches, if you add symbols
there, it typically should be that all symbols added together can share the
same new symbol version, but for symbols added at different times different
symbol versions should be used.

> But symbol versions are also permanent; now that there are apps in the
> world that want foo at KEYUTILS_1.4, you can never remove that.  You could
> add it to _1.5 too, but having made the error it's not really fixing
> anything to do that.

Yeah.  You could have foo at KEYUTILS_1.4 as something users can't link to
and foo@@KEYUTILS_1.5 if you want.

	Jakub


More information about the devel mailing list