glibc/csu
Szabolcs Nagy ffb17e7ba3 rtld: Avoid using up static TLS surplus for optimizations [BZ #25051]
On some targets static TLS surplus area can be used opportunistically
for dynamically loaded modules such that the TLS access then becomes
faster (TLSDESC and powerpc TLS optimization). However we don't want
all surplus TLS to be used for this optimization because dynamically
loaded modules with initial-exec model TLS can only use surplus TLS.

The new contract for surplus static TLS use is:

- libc.so can have up to 192 bytes of IE TLS,
- other system libraries together can have up to 144 bytes of IE TLS.
- Some "optional" static TLS is available for opportunistic use.

The optional TLS is now tunable: rtld.optional_static_tls, so users
can directly affect the allocated static TLS size. (Note that module
unloading with dlclose does not reclaim static TLS. After the optional
TLS runs out, TLS access is no longer optimized to use static TLS.)

The default setting of rtld.optional_static_tls is 512 so the surplus
TLS is 3*192 + 4*144 + 512 = 1664 by default, the same as before.

Fixes BZ #25051.

Tested on aarch64-linux-gnu and x86_64-linux-gnu.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2020-07-08 17:32:56 +01:00
..
abi-note.c Rewrite abi-note.S in C. 2020-07-08 15:02:37 +01:00
check_fds.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
dso_handle.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
elf-init.c Introduce <elf-initfini.h> and ELF_INITFINI for all architectures 2020-02-18 15:12:25 +01:00
errno-loc.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
errno.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
gmon-start.c Introduce <elf-initfini.h> and ELF_INITFINI for all architectures 2020-02-18 15:12:25 +01:00
init-first.c Remove NO_CTORS_DTORS_SECTIONS macro 2020-05-18 15:39:34 +02:00
init.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libc-start.c elf: Add initial flag argument to __libc_early_init 2020-04-29 15:44:03 +02:00
libc-tls.c rtld: Avoid using up static TLS surplus for optimizations [BZ #25051] 2020-07-08 17:32:56 +01:00
Makefile Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
start.c More fallout from supporting only ELF 2012-01-08 00:45:01 -05:00
static-reloc.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
sysdep.c Moved to csu/errno-loc.c. 2005-12-14 15:06:39 +00:00
version.c Update copyright dates not handled by scripts/update-copyrights. 2020-01-01 00:21:22 +00:00
Versions Remove unused %include lines from Versions files. 2014-02-22 00:58:54 -08:00