From bb0ddc2f1eca652aa8af56825b2ba3182498cc5a Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 2 Mar 2003 11:45:12 +0000 Subject: * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_fixup_plt): Don't use weak_extern for dl_rtld_map. Instead check only if [SHARED]. (elf_machine_rela): Clean up. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Clean up. PowerPC TLS support contributed by Paul Mackerras . * sysdeps/powerpc/powerpc32/elf/configure.in: New file. * sysdeps/powerpc/powerpc32/elf/configure: New generated file. * elf/tls-macros.h [__powerpc__ && !__powerpc64__] (TLS_LE, TLS_IE, TLS_LD, TLS_GD): Define them. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Support new relocs for TLS. * sysdeps/powerpc/dl-tls.h (TLS_TP_OFFSET, TLS_DTV_OFFSET): Move these macros out of [SHARED]. (TLS_TPREL_VALUE, TLS_DTPREL_VALUE): New macros. * elf/elf.h: Define R_PPC_* relocs for TLS support. Clean up R_PPC64_* macro definition comments. --- linuxthreads/pthread.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'linuxthreads/pthread.c') diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c index 2888a6a2f7..01be30ba12 100644 --- a/linuxthreads/pthread.c +++ b/linuxthreads/pthread.c @@ -566,8 +566,10 @@ int __pthread_initialize_manager(void) #endif __pthread_multiple_threads = 1; - __pthread_main_thread->p_header.data.multiple_threads = 1; - * __libc_multiple_threads_ptr = 1; +#if TLS_MULTIPLE_THREADS_IN_TCB || !defined USE_TLS || !TLS_DTV_AT_TP + __pthread_main_thread->p_multiple_threads = 1; +#endif + *__libc_multiple_threads_ptr = 1; #ifndef HAVE_Z_NODELETE if (__builtin_expect (&__dso_handle != NULL, 1)) @@ -611,9 +613,13 @@ int __pthread_initialize_manager(void) __pthread_handles[1].h_descr = manager_thread = mgr; /* Initialize the descriptor. */ +#if !defined USE_TLS || !TLS_DTV_AT_TP mgr->p_header.data.tcb = tcbp; mgr->p_header.data.self = mgr; mgr->p_header.data.multiple_threads = 1; +#elif TLS_MULTIPLE_THREADS_IN_TCB + mgr->p_multiple_threads = 1; +#endif mgr->p_lock = &__pthread_handles[1].h_lock; # ifndef HAVE___THREAD mgr->p_errnop = &mgr->p_errno; -- cgit v1.2.3