On Fri, Dec 12, 2003 at 11:58:52AM -0500, Jeremy Katz wrote:
> One additional thought/question ... OK, so you have /lib -
/lib64 and /usr/lib
> - /usr/lib64 ... how does a program which needs a library get the "right"
one
> since they are named the same?
The right library gets chosen because although they have the same name,
they're not the same as far as what the DT_NEEDED is. The DT_NEEDED for
a 64bit library is something like libc.so.6(GLIBC_2.3.2)(64bit) instead
of libc.so.6(GLIBC_2.3.2). The x86_64 ldconfig can handle both ELF32
and ELF64 and so sets the caches up correctly. The right dynamic loader
gets used because PT_INTERP gets set up correctly when the program is
build (it references /lib64/ld-linux-x86-64.so.2)
DT_NEEDED contains just libc.so.6 for both 32-bit and 64-bit. Symbol
version needs are in .gnu.version_r and 32-bit/64-bit is simple - a 32-bit
program/shared library always wants 32-bit dependencies, 64-bit
program/shlib wants 64-bit libraries.
What you wrote above are what rpm's provides/requires contain.
Jakub