Originally posted by zander
Even these older revisions of nvidia-installer place the appropriate NVIDIA libGL in /usr/lib/tls, however, which leaves the question why the libraries in /usr/X11R6/lib/tls have precedence, when they shouldn't:
Either way, one can only hope that distributors such as RedHat and hardware vendors such as NVIDIA (as well as distributors/vendors among themselves) will find ways to coordinate their efforts more efficiently in the future.
[root@fedora root]# ldconfig -p | grep libGL.so
libGL.so.1 (libc6, hwcap: 0x8000000000000000) => /usr/X11R6/lib/tls/libGL.so.1
libGL.so.1 (libc6, hwcap: 0x8000000000000000) => /usr/lib/tls/libGL.so.1
libGL.so.1 (libc6) => /usr/lib/libGL.so.1
libGL.so (libc6, hwcap: 0x8000000000000000) => /usr/lib/tls/libGL.so
libGL.so (libc6) => /usr/lib/libGL.so
[root@fedora root]# ldd /usr/X11R6/bin/glxgears
libGL.so.1 => /usr/X11R6/lib/tls/libGL.so.1 (0x00732000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x00101000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x00d20000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00147000)
libm.so.6 => /lib/tls/libm.so.6 (0x00cf7000)
libc.so.6 => /lib/tls/libc.so.6 (0x00bbc000)
libdl.so.2 => /lib/libdl.so.2 (0x00d1b000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00ba4000)
I read an article about this awhile back. Basically, the lib search order is stored within the binary itself, so that's how the code was written and linked.
There are even some utilities out there for patching a binary to change the order, or even add new entries into the table.