From a52d15621f2f03891944550b0b71ff117e15c16a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 9 Feb 2002 01:41:44 +0000 Subject: Update. 2002-02-08 Ulrich Drepper * elf/rtld.c (_dl_start_final): Install DTV explicitly. (dl_main): Move dtv/static TLS handling before relocation. Unconditionally call _dl_tlsoffset. Call _dl_allocate_tls and TLS_INIT_TP to allocate and install the dtv/static TLS block. * sysdeps/generic/dl-tls.c (_dl_determine_tlsoffset): If no object so far uses TLS initialize GL(dl_tls_static_size) and GL(dl_tls_static_align) to account for the TCB. (_dl_allocate_tls): New function. * sysdeps/generic/ldsodefs.h (rtld_global): Add _dl_initial_dtv_malloced. * configure.in: Test for __builtin_memset more realistically. * csu/version.c (banner): If TLS support available say so. --- linuxthreads/sysdeps/i386/tls.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'linuxthreads') diff --git a/linuxthreads/sysdeps/i386/tls.h b/linuxthreads/sysdeps/i386/tls.h index ed5e634a82..4d701cc6e8 100644 --- a/linuxthreads/sysdeps/i386/tls.h +++ b/linuxthreads/sysdeps/i386/tls.h @@ -42,7 +42,7 @@ typedef struct /* We can support TLS only if the floating-stack support is available. */ -#ifdef HAVE_TLS_SUPPORT +#if defined FLOATING_STACKS && defined HAVE_TLS_SUPPORT /* Get system call information. */ # include @@ -66,10 +66,15 @@ typedef struct thread pointer points to is unspecified. Allocate the TCB there. */ # define TLS_TCB_AT_TP 1 + +/* Install the dtv pointer. */ +# define INSTALL_DTV(descr, dtvp) \ + ((tcbhead_t *) descr)->dtv = dtvp + /* Code to initially initialize the thread pointer. This might need special attention since 'errno' is not yet available and if the operation can cause a failure 'errno' must not be touched. */ -# define TLS_INIT_TP(descr, dtvp) \ +# define TLS_INIT_TP(descr) \ do { \ void *_descr = (descr); \ struct modify_ldt_ldt_s ldt_entry = \ @@ -78,7 +83,6 @@ typedef struct tcbhead_t *head = _descr; \ \ head->tcb = _descr; \ - head->dtv = dtvp; \ \ asm ("pushl %%ebx\n\t" \ "movl $1, %%ebx\n\t" \ @@ -94,16 +98,10 @@ typedef struct /* Return the address of the dtv for the current thread. */ -# if FLOATING_STACKS -# define THREAD_DTV() \ +# define THREAD_DTV() \ ({ struct _pthread_descr_struct *__descr; \ THREAD_GETMEM (__descr, p_header.data.dtvp); }) -# else -# define THREAD_DTV() \ - ({ struct _pthread_descr_struct *__descr = thread_self (); \ - THREAD_GETMEM (__descr, p_header.data.dtvp); }) -# endif -#endif /* HAVE_TLS_SUPPORT */ +#endif /* FLOATING_STACKS && HAVE_TLS_SUPPORT */ #endif /* tls.h */ -- cgit v1.2.3