Re: ldd and library dependency
- From: Laurenz Albe <invite@xxxxxxxxxxxxxxx>
- Date: 08 Mar 2006 09:26:50 GMT
Frank Hamersley <terabitemightbe@xxxxxxxxxxx> wrote:
My issue is similar only in that library selection is not as I would
expect in that libraries from /lib/tls are selected by ldd rather than
the /lib instances that I require.
As I did not know the answer right away, I investigated and here is the
result, which I get from
http://people.redhat.com/drepper/assumekernel.html
which I found with a web search.
Some shared libraries contain an OS ABI tag, that is a section that
tells the dynamic loader which kernel version is required to run this
library.
On RedHat systems you can see it with
eu-readelf -n /lib/libm-2.3.2.so
on other systems you can use
objdump -s -j .note.ABI-tag /lib/tls/libm-2.3.2.so
to get a slightly less readable version (bytes 21, 25, and 29 from
the section contain the version numbers).
On my RedHat system, there are some libraries that have versions in
/lib, /lib/i686 and /lib/tls (which stands for Thread-Local Storage),
among them libc, and the OS ABI versions of the libraries increase in
that order (2.2.5, 2.4.1 and 2.4.20, respectively).
The loader chooses the library with the highest ABI version less or equal
to the kernel version.
If for some reason you need to use an older ABI version (that is, load the
library form one of the other directories), you can use the environment
variable LD_ASSUME_KERNEL to tell the loader which kernel version to assume.
So if you insist in loading from /lib (I hope that you have good reasons),
you should set LD_ASSUME_KERNEL to something between 2.2.5 and 2.4.0
(if the numbers on your system are the same as on my system).
Yours,
Laurenz Albe
.
- Follow-Ups:
- Re: ldd and library dependency
- From: Frank Hamersley
- Re: ldd and library dependency
- References:
- ldd and library dependency
- From: Buzzard
- Re: ldd and library dependency
- From: Dave Uhring
- Re: ldd and library dependency
- From: Nico Kadel-Garcia
- Re: ldd and library dependency
- From: Laurenz Albe
- Re: ldd and library dependency
- From: Frank Hamersley
- ldd and library dependency
- Prev by Date: SOS! Root filled, want to recover MySQL data!
- Next by Date: Re: SOS! Root filled, want to recover MySQL data!
- Previous by thread: Re: ldd and library dependency
- Next by thread: Re: ldd and library dependency
- Index(es):
Relevant Pages
|