From 13a6cfff31774dd06b861f1f4a9b0e36fa5ac01d Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 12 Oct 2015 16:21:54 +0200 Subject: fix static binaries linked with pthread and compiled with ssp Move TLS initialization for static builds up to the calling function as suggested by Daniel Fahlgren. Reported-By: Daniel Fahlgren --- libpthread/nptl/init.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'libpthread/nptl/init.c') diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c index a9706d1b4..bcd49edff 100644 --- a/libpthread/nptl/init.c +++ b/libpthread/nptl/init.c @@ -60,15 +60,9 @@ int __have_futex_clock_realtime; /* Version of the library, used in libthread_db to detect mismatches. */ static const char nptl_version[] __attribute_used__ = VERSION; - -#ifndef SHARED -extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign); -#endif - #ifdef SHARED static void nptl_freeres (void); - static const struct pthread_functions pthread_functions = { .ptr_pthread_attr_destroy = __pthread_attr_destroy, @@ -265,18 +259,6 @@ __pthread_initialize_minimal_internal (void) return; initialized = 1; -#ifndef SHARED - /* Unlike in the dynamically linked case the dynamic linker has not - taken care of initializing the TLS data structures. */ - __libc_setup_tls (TLS_TCB_SIZE, TLS_TCB_ALIGN); - - /* We must prevent gcc from being clever and move any of the - following code ahead of the __libc_setup_tls call. This function - will initialize the thread register which is subsequently - used. */ - __asm__ __volatile__ (""); -#endif - /* Minimal initialization of the thread descriptor. */ struct pthread *pd = THREAD_SELF; INTERNAL_SYSCALL_DECL (err); -- cgit v1.2.3