This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCHv2] Fix static TLS exhaustion by TLS descriptors
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Kyle McMartin <kmcmarti at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 21 Nov 2014 03:16:41 -0200
- Subject: Re: [PATCHv2] Fix static TLS exhaustion by TLS descriptors
- Authentication-results: sourceware.org; auth=none
- References: <20140603175042 dot GH15355 at redacted dot bos dot redhat dot com>
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