Shared objects question
If I compile my libraries into shared objects, how is the Solaris system handling them...
If I first compile one version of the library and calling it lib.so1, then after a while I've changed a lot and compile into a new shared object that I call lib.so2. What happends if the system that runs my application (that use my library) loads the shared object? Will it load the lib.so2 or lib.so1? This could be a problem if the application loads wrong library....
Anyone can point me into a direction for how the regular namning conventions are performed for shared objects?
I also saw that Solaris have all the .so files linked to one of the versions of the shared objects (if several verisons exists), is this a solution?
Best Regards
[764 byte] By [
Nergal] at [2007-11-26 10:46:06]

# 1
> If I compile my libraries into shared objects, how is the Solaris system handling them...
I am sure you will find this link useful: http://docs.sun.com/app/docs/doc/817-1983
> Will it load the lib.so2 or lib.so1?
First of all, there should be a dot after "so": lib.so.1 and lib.so.2. General practice (and I guess a rule of thumb) is to
- link you binary against lib.so
- make lib.so a symlink to lib.so.1 when you have first version of your library
- when lib.so.2 comes up, change lib.so symlink to point to lib.so.2 and it will be picked by the dynamic linker for your binary.
Library filename suffix doesn't have any special meaning for the dynami linker. Different versions are handled in another fashion:
http://docs.sun.com/app/docs/doc/817-1983/6mhm6r4g1?q=version&a=view