This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH 2/2] bfd/elfnn-aarch64.c: set DF_STATIC_TLS when emitting IE relocs
- From: Alan Modra <amodra at gmail dot com>
- To: Kyle McMartin <kmcmarti at redhat dot com>
- Cc: Marcus Shawcroft <marcus dot shawcroft at arm dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>, "will dot newton at linaro dot org" <will dot newton at linaro dot org>, "nickc at redhat dot com" <nickc at redhat dot com>
- Date: Wed, 2 Jul 2014 01:12:05 +0930
- Subject: Re: [PATCH 2/2] bfd/elfnn-aarch64.c: set DF_STATIC_TLS when emitting IE relocs
- Authentication-results: sourceware.org; auth=none
- References: <20140701001808 dot GB9511 at redacted dot bos dot redhat dot com> <53B27938 dot 3040203 at arm dot com> <20140701141428 dot GD9511 at redacted dot bos dot redhat dot com>
On Tue, Jul 01, 2014 at 10:14:28AM -0400, Kyle McMartin wrote:
> it seems to be about half and half who tests what:
> i386, x86_64, ppc all set if !info->executable
> sparc, mips, alpha all set if info->shared
DF_STATIC_TLS is a flag that says the object is using thread pointer
relative addressing of TLS. ie. the thread local storage for that
object must be laid out at program startup, which means the object
can't be dlopen'd (*). So DF_STATIC_TLS is a flag for objects that
might be dlopen'd. Hmm, and since we can actually dlopen any ET_DYN
including PIEs it would seem that info->shared is the correct test.
*) Except that glibc allocates some extra thread local storage,
and therefore can dynamically load shared libraries with static tls.
Australia Development Lab, IBM