This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Linking problems on CentOS 4.9

On Wed, Nov 04, 2015 at 10:43:02AM -0800, Michael Smith wrote:
> My expectation from compiling with the system ld, and on every other
> system I've built on (a large number), is that is sufficient for
> resolving __tls_get_addr at runtime. With successful builds I see a
> dependency setup against /lib64/ without having to
> specify it explicitly.

Andreas is correct.  Normally, TLS sequences are optimised by the
linker when linking an executable, so there won't be any references
to __tls_get_addr left to cause undefined symbol errors.  However, if
you are linking statically and the link optimisation fails or is
disabled by a linker option, then the static libc needs to provide
__tls_get_addr.  If you are not linking statically, then glibc's is a linker script that arranges to include,
libc_nonshared.a, and on x86_64,

> On Wed, Nov 4, 2015 at 9:46 AM, Andreas Schwab <> wrote:
> > Michael Smith <> writes:
> >
> >> That happens despite __tls_get_addr being defined in
> >> /lib64/, and the link command including
> >> '-dynamic-linker /lib64/'.
> >
> > -dynamic-linker only sets the interpreter section, it does not add
> > anything to the list of linked objects.

Alan Modra
Australia Development Lab, IBM

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]