[PATCH 2/2] bfd/elfnn-aarch64.c: set DF_STATIC_TLS when emitting IE relocs

Alan Modra amodra@gmail.com
Tue Jul 1 15:42:00 GMT 2014


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.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list