about summary refs log tree commit diff
path: root/linuxthreads/sysdeps/i386/tls.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-02-09 01:41:44 +0000
committerUlrich Drepper <drepper@redhat.com>2002-02-09 01:41:44 +0000
commita52d15621f2f03891944550b0b71ff117e15c16a (patch)
tree14cace4b408dc7ee21138ad62550a2123445ad8a /linuxthreads/sysdeps/i386/tls.h
parent013aafb7d098153e8df3a133ce6302c20396a33f (diff)
downloadglibc-a52d15621f2f03891944550b0b71ff117e15c16a.tar.gz
glibc-a52d15621f2f03891944550b0b71ff117e15c16a.tar.xz
glibc-a52d15621f2f03891944550b0b71ff117e15c16a.zip
Update.
2002-02-08  Ulrich Drepper  <drepper@redhat.com>

	* 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.
Diffstat (limited to 'linuxthreads/sysdeps/i386/tls.h')
-rw-r--r--linuxthreads/sysdeps/i386/tls.h20
1 files changed, 9 insertions, 11 deletions
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 <sysdep.h>
@@ -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 */