glibc/csu
Florian Weimer cbd9fd2369 Consolidate TLS block allocation for static binaries with ld.so
Use the same code to compute the TLS block size and its alignment.
The code in elf/dl-tls.c is linked in anyway for all binaries
due to the reference to _dl_tls_static_surplus_init.

It is not possible to call _dl_allocate_tls_storage directly
because malloc is not available in the static case.  (The
dynamic linker uses the minimal malloc at this stage.)  Therefore,
split _dl_tls_block_size_with_pre and _dl_tls_block_align from
_dl_allocate_tls_storage, and call those new functions from
__libc_setup_tls.

This fixes extra TLS allocation for the static case, and apparently
some pre-existing bugs as well (the independent recomputation of
TLS block sizes in init_static_tls looks rather suspect).

Fixes commit 0e411c5d30 ("Add generic
'extra TLS'").
2025-01-16 20:02:42 +01:00
..
abi-note.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
check_fds.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
dso_handle.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
errno-loc.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
errno.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
gmon-start.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
init-first.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
init.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
libc-start.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
libc-tls.c Consolidate TLS block allocation for static binaries with ld.so 2025-01-16 20:02:42 +01:00
Makefile Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
rtld-sizes.sym Extend struct r_debug to support multiple namespaces [BZ #15971] 2021-09-19 13:51:35 -07: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 2025-01-01 11:22:09 -08:00
sysdep.c Moved to csu/errno-loc.c. 2005-12-14 15:06:39 +00:00
version.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
Versions Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00