This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCHv2] Fix static TLS exhaustion by TLS descriptors


Hi, Kyle,

On Jun  3, 2014, Kyle McMartin <kmcmarti@redhat.com> wrote:

> AArch64 presently defaults to use TLS descriptors, as opposed to
> traditional dynamic TLS relocations, and has hit a bug in the copy-pasta
> used in elf_machine_rel{,a} for all TLS descriptor implementations. When
> a program calls dlopen() with R_AARCH64_TLSDESC relocs, we're consuming
> static TLS until it's exhausted (presumably as an optimisation.)
> However, this means that once our static TLS space is consumed,
> attempting to dlopen() any shared object which contain an
> R_AARCH64_TPREL reloc will fail, since we've exhausted all the space.

> Instead, always use dynamic TLS for TLS descriptors, which lets us load
> arbitrarily many proper dynamic TLS using shared objects, and allow the
> static TLS fallback only in the non-SHARED case.

This approach severely worsens performance of TLS Descriptors.

If what you're running into is the DTV limit for Static TLS, rather than
Static TLS space proper, please consider using in its stead the final
version (still under review) of the patch I posted this week, with
Subject: â[BZ#17090/17620/17621]: fix DTV race, assert, and DTV_SURPLUS
Static TLS limitâ.  It should allow TPREL relocs regardless of how many
TLS modules you've loaded before, static or dynamic, except in the
unlikely case of actually filling up the Static TLS segment.

Please let me know if you have any problems with it.

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer


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