Operating System - Linux
1829102 Members
2371 Online
109986 Solutions
New Discussion

Re: Wht is the difference between /lib & /lib/tls in Redhat Enterprise server 3.0

 
SOLVED
Go to solution
Rajan_sa
Advisor

Wht is the difference between /lib & /lib/tls in Redhat Enterprise server 3.0

Hi ,

I am new to Linux. I have one question regarding the libraries.In Redhat Enterprise Server 3.0 there are two directories for the libraries one is /lib & the other is /lib/tls.When I try to use libc by default it takes me to /lib/tls.libc-x.xx.x file but I want to use /lib/libc-x.xx.x file.. I did'nt get it wht is this /lib/tls folder for & why are there two instance of the same file in these two locations plus size wise also they differ..
1 REPLY 1
Ermin Borovac
Honored Contributor
Solution

Re: Wht is the difference between /lib & /lib/tls in Redhat Enterprise server 3.0

Libraries in /lib/tls are new NPTL POSIX thread libraries. By default, programs are linked with libc in /lib/tls. To change this you have to set LD_ASSUME_KERNEL variable.

$ export LD_ASSUME_KERNEL=2.2.5
$ ldd /bin/ls | grep libc
libc.so.6 => /lib/libc.so.6 (0xf6eb6000)

To find out version number to use with LD_ASSUME_KERNEL you can run eu-readelf on libc library (eu-readelf is in elfutils package).

$ /usr/bin/eu-readelf -n /lib/libc-2.3.3.so

Note segment of 32 bytes at offset 0x154:
Owner Data size Type
GNU 16 VERSION
OS: Linux, ABI: 2.2.5