about summary refs log tree commit diff
path: root/linuxthreads
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-01-16 18:24:32 +0000
committerUlrich Drepper <drepper@redhat.com>2003-01-16 18:24:32 +0000
commit850dcfcafe6c1cc9e59763a882a25a2f0c2c4d68 (patch)
tree988a3b6a1130ece7cb796db6f01cb8d367dfbf80 /linuxthreads
parenta1f8ec97fdaf3e0636957bfc3861651869c60b40 (diff)
downloadglibc-850dcfcafe6c1cc9e59763a882a25a2f0c2c4d68.tar.gz
glibc-850dcfcafe6c1cc9e59763a882a25a2f0c2c4d68.tar.xz
glibc-850dcfcafe6c1cc9e59763a882a25a2f0c2c4d68.zip
Update.
2003-01-16  Jakub Jelinek  <jakub@redhat.com>

	* elf/dl-load.c (_dl_map_object_from_fd): Use
	GL(dl_tls_dtv_slotinfo_list) != NULL to check whether TLS has
	been already initialized.
Diffstat (limited to 'linuxthreads')
-rw-r--r--linuxthreads/ChangeLog6
-rw-r--r--linuxthreads/pthread.c2
-rw-r--r--linuxthreads/sysdeps/ia64/tcb-offsets.sym5
-rw-r--r--linuxthreads/sysdeps/ia64/tls.h28
4 files changed, 30 insertions, 11 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 6a844b928c..990ebb3bae 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,5 +1,11 @@
 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
 
+	* pthread.c (_pthread_initialize_minimal): Use
+	GL(dl_tls_dtv_slotinfo_list) != NULL to check whether TLS has
+	been already initialized.
+
+2003-01-16  Jakub Jelinek  <jakub@redhat.com>
+
 	* sysdeps/i386/tls.h (INIT_SYSINFO): Initialize head->sysinfo even
 	if not SHARED.
 
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index f72e20ee09..2888a6a2f7 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -305,7 +305,7 @@ __pthread_initialize_minimal(void)
      taken care of initializing the TLS data structures.  */
   __libc_setup_tls (TLS_TCB_SIZE, TLS_TCB_ALIGN);
 # elif !USE___THREAD
-  if (__builtin_expect (GL(dl_tls_max_dtv_idx) == 0, 0))
+  if (__builtin_expect (GL(dl_tls_dtv_slotinfo_list) == NULL, 0))
     {
       tcbhead_t *tcbp;
 
diff --git a/linuxthreads/sysdeps/ia64/tcb-offsets.sym b/linuxthreads/sysdeps/ia64/tcb-offsets.sym
index a1d199f44e..2b677f5abb 100644
--- a/linuxthreads/sysdeps/ia64/tcb-offsets.sym
+++ b/linuxthreads/sysdeps/ia64/tcb-offsets.sym
@@ -1,4 +1,9 @@
 #include <sysdep.h>
 #include <tls.h>
 
+--
+#ifdef USE_TLS
 MULTIPLE_THREADS_OFFSET offsetof (struct _pthread_descr_struct, p_header.data.multiple_threads) - sizeof (struct _pthread_descr_struct)
+#else
+MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
+#endif
diff --git a/linuxthreads/sysdeps/ia64/tls.h b/linuxthreads/sysdeps/ia64/tls.h
index b2c47c00a6..238ea08399 100644
--- a/linuxthreads/sysdeps/ia64/tls.h
+++ b/linuxthreads/sysdeps/ia64/tls.h
@@ -32,13 +32,6 @@ typedef union dtv
   void *pointer;
 } dtv_t;
 
-
-typedef struct
-{
-  dtv_t *dtv;
-  void *private;
-} tcbhead_t;
-
 #else /* __ASSEMBLER__ */
 # include <tcb-offsets.h>
 #endif /* __ASSEMBLER__ */
@@ -49,6 +42,13 @@ typedef struct
 # define USE_TLS        1
 
 # ifndef __ASSEMBLER__
+
+typedef struct
+{
+  dtv_t *dtv;
+  void *private;
+} tcbhead_t;
+
 /* This is the size of the initial TCB.  */
 #  define TLS_INIT_TCB_SIZE sizeof (tcbhead_t)
 
@@ -106,14 +106,22 @@ typedef struct
 #else
 
 # ifndef __ASSEMBLER__
+
+typedef struct
+{
+  void *tcb;
+  dtv_t *dtv;
+  void *self;
+  int multiple_threads;
+} tcbhead_t;
+
 /* Get the thread descriptor definition.  */
 #  include <linuxthreads/descr.h>
 
 #  define NONTLS_INIT_TP \
   do { 									\
-    static struct _pthread_descr_struct nontls_init_tp			\
-      = { .p_header.data.multiple_threads = 0 };			\
-    __thread_self = ((__typeof (__thread_self)) &nontls_init_tp) + 1;	\
+    static const tcbhead_t nontls_init_tp = { .multiple_threads = 0 };	\
+    __thread_self = (__typeof (__thread_self)) &nontls_init_tp;		\
   } while (0)
 
 #endif