From: Florian Weimer Date: Sun, 2 Feb 2025 15:22:23 +0000 (+0100) Subject: elf: Build dl-tls.o with early startup symbol redirections X-Git-Tag: glibc-2.42~523 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68c9ef4419b8a4574dacc8e96296ec24bdc01da8;p=thirdparty%2Fglibc.git elf: Build dl-tls.o with early startup symbol redirections This is required when building for powerpc64le POWER8 with GCC 8 at least. Fixes commit cbd9fd236981717d3d4ee942986ea912e9707c32 ("Consolidate TLS block allocation for static binaries with ld.so"). Reviewed-by: Adhemerval Zanella --- diff --git a/csu/libc-tls.c b/csu/libc-tls.c index 07c37f3af9..0da39b72b4 100644 --- a/csu/libc-tls.c +++ b/csu/libc-tls.c @@ -30,6 +30,7 @@ #include #include #include +#include #ifdef SHARED #error makefile bug, this file is for static only diff --git a/elf/dl-tls.c b/elf/dl-tls.c index 8306a39e8d..5178d9b66a 100644 --- a/elf/dl-tls.c +++ b/elf/dl-tls.c @@ -39,6 +39,12 @@ #include +/* This code is used during early startup when statically linked, + via __libc_setup_tls in csu/libc-tls.c. */ +#ifndef SHARED +# include +#endif + /* Surplus static TLS, GLRO(dl_tls_static_surplus), is used for - IE TLS in libc.so for all dlmopen namespaces except in the initial