[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shared library versions



Mark Ferlatte wrote:
Russell Shaw said on Wed, Sep 03, 2003 at 03:42:43PM +1000:

Hi,
How do programs determine what version of a shared (.so) library
they get when run?


They use whatever version they are linked against.  Sometimes they are linked
against libfoo.so, which is a symlink to the current default, other times they
are linked against libfoo.so.1.2.3.4, so they will require that specific
version to be present.

The dynamic linker worries about all of this for you, on startup.  You can use
the ldd command to determine which libs a given executable wants (ie, ldd
/bin/ls).

I'm tracking down a bug in xgettext (from gettext 0.12.1):

debconf2po-update

  xgettext: error while loading shared libraries:
                libgettextsrc-0.11.5.so: cannot open
                shared object file: No such file or directory

gettext installs:

  /usr/lib/libgettextsrc.so

which is a symlink to: libgettextsrc-0.12.1.so

So, xgettext should look for the libgettextsrc.so symlink.

If a program calls a shared library via a symlink, how does
it tell the linker what version to get?



Reply to: