I\'m trying to learn more about library versioning in Linux and how to put it all to work. Here\'s the context:
-- I have two versions of a dynamic library which exp
Try compiling both libsome1.so
and libsome2.so
to add symbol versioning, each with their own version (use the --version-script
option to ld
). Then link the application and libmagic.so
using the new libraries. Then, libsome1.so
and libsome2.so
should be completely separate.
Problems can still occur if there are unversioned references to symbols. Such references can be satisfied by versioned definitions (so that it is possible to add symbol versioning to a library without breaking binary compatibility). If there are multiple symbols of the same name, it can sometimes be hard to predict which one will be used.
Regarding tools, nm -D
does not display any information about symbol versioning. Try objdump -T
or readelf -s
instead.