about summary refs log tree commit diff
path: root/linuxthreads
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-08-12 06:25:47 +0000
committerRoland McGrath <roland@gnu.org>2002-08-12 06:25:47 +0000
commite6f526809dbca3e772147b7bdedc3ebca8aff30e (patch)
tree8d01638a6124709150e9dd99bdd2073c1da27378 /linuxthreads
parent7a8bdff02c8bc80d5068eadf83302595d11f46d4 (diff)
downloadglibc-e6f526809dbca3e772147b7bdedc3ebca8aff30e.tar.gz
glibc-e6f526809dbca3e772147b7bdedc3ebca8aff30e.tar.xz
glibc-e6f526809dbca3e772147b7bdedc3ebca8aff30e.zip
* elf/tst-tlsmod4.c (in_dso): Insert a random library call before use
	of the TLS macros, otherwise the compiler might not have initialized
	the PIC register yet when we use the PLT via asm.
	* elf/tst-tlsmod3.c (in_dso2): Likewise.
	* elf/tst-tlsmod2.c (in_dso): Likewise.
Diffstat (limited to 'linuxthreads')
-rw-r--r--linuxthreads/ChangeLog10
-rw-r--r--linuxthreads/manager.c2
-rw-r--r--linuxthreads/pthread.c2
3 files changed, 12 insertions, 2 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index a6a2e9b7e1..67be250bd1 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,3 +1,13 @@
+2002-08-11  Roland McGrath  <roland@redhat.com>
+
+	* pthread.c (__pthread_initialize_manager): Initialize
+	p_header.data.tcb field of manager thread's descriptor.
+	(__pthread_initialize_minimal): Don't initialize p_header.data.self
+	field, already done by TLS_INIT_TP.
+
+	* manager.c (pthread_handle_create): Move p_header field initializers
+	together.
+
 2002-08-08  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Removed.
diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c
index 8ad9eb521b..655c7d64ab 100644
--- a/linuxthreads/manager.c
+++ b/linuxthreads/manager.c
@@ -644,6 +644,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
   /* Initialize the thread descriptor.  Elements which have to be
      initialized to zero already have this value.  */
   new_thread->p_header.data.tcb = new_thread;
+  new_thread->p_header.data.self = new_thread;
   new_thread->p_tid = new_thread_id;
   new_thread->p_lock = &(__pthread_handles[sseg].h_lock);
   new_thread->p_cancelstate = PTHREAD_CANCEL_ENABLE;
@@ -655,7 +656,6 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
 #endif
   new_thread->p_guardaddr = guardaddr;
   new_thread->p_guardsize = guardsize;
-  new_thread->p_header.data.self = new_thread;
   new_thread->p_nr = sseg;
   new_thread->p_inheritsched = attr ? attr->__inheritsched : 0;
   /* Initialize the thread handle */
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index cc4d26d304..c43176c40f 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -429,7 +429,6 @@ __pthread_initialize_minimal(void)
      part of the TLS allocation.  We have to initialize the data
      structure by hand.  This initialization must mirror the struct
      definition above.  */
-  self->p_header.data.self = self;
   self->p_nextlive = self->p_prevlive = self;
   self->p_tid = PTHREAD_THREADS_MAX;
   self->p_lock = &__pthread_handles[0].h_lock;
@@ -633,6 +632,7 @@ int __pthread_initialize_manager(void)
   }
 
   /* Initialize the descriptor.  */
+  tcb->p_header.data.tcb = tcb;
   tcb->p_header.data.self = tcb;
   tcb->p_lock = &__pthread_handles[1].h_lock;
 # ifndef HAVE___THREAD