From 520a5887057c328c99304d6947453eb06351f5fd Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 7 Sep 2021 16:33:21 +0300 Subject: elf: Replace most uses of THREAD_GSCOPE_IN_TCB While originally this definition was indeed used to distinguish between the cases where the GSCOPE flag was stored in TCB or not, it has since become used as a general way to distinguish between HTL and NPTL. THREAD_GSCOPE_IN_TCB will be removed in the following commits, as HTL, which currently is the only port that does not put the flag into TCB, will get ported to put the GSCOPE flag into the TCB as well. To prepare for that change, migrate all code that wants to distinguish between HTL and NPTL to use PTHREAD_IN_LIBC instead, which is a better choice since the distinction mostly has to do with whether libc has access to the list of thread structures and therefore can initialize thread-local storage. The parts of code that actually depend on whether the GSCOPE flag is in TCB are left unchanged. Signed-off-by: Sergey Bugaev Message-Id: <20210907133325.255690-2-bugaevc@gmail.com> Reviewed-by: Samuel Thibault --- elf/dl-reloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'elf/dl-reloc.c') diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c index e13a672ade..6c957456b8 100644 --- a/elf/dl-reloc.c +++ b/elf/dl-reloc.c @@ -141,7 +141,7 @@ cannot allocate memory in static TLS block")); } } -#if !THREAD_GSCOPE_IN_TCB +#if !PTHREAD_IN_LIBC /* Initialize static TLS area and DTV for current (only) thread. libpthread implementations should provide their own hook to handle all threads. */ @@ -160,7 +160,7 @@ _dl_nothread_init_static_tls (struct link_map *map) memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size), '\0', map->l_tls_blocksize - map->l_tls_initimage_size); } -#endif /* !THREAD_GSCOPE_IN_TCB */ +#endif /* !PTHREAD_IN_LIBC */ void _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[], -- cgit 1.4.1