about summary refs log tree commit diff
path: root/linuxthreads/pthread.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-10-15 06:24:26 +0000
committerUlrich Drepper <drepper@redhat.com>2003-10-15 06:24:26 +0000
commita21a20a33f5b49cfc06ed72f3164099ce226a0b9 (patch)
treeeb1717e035a4f8f86694d722a7f8d568a95c02c5 /linuxthreads/pthread.c
parent1769a73f0bd6e11590ed88eea4391284585216d7 (diff)
downloadglibc-a21a20a33f5b49cfc06ed72f3164099ce226a0b9.tar.gz
glibc-a21a20a33f5b49cfc06ed72f3164099ce226a0b9.tar.xz
glibc-a21a20a33f5b49cfc06ed72f3164099ce226a0b9.zip
Update.
2003-10-15  Jakub Jelinek  <jakub@redhat.com>

	* elf/rtld.c (print_statistics): Print also number of relative
	relocations.
Diffstat (limited to 'linuxthreads/pthread.c')
-rw-r--r--linuxthreads/pthread.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index b3953542e0..11d2ef7dd1 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -893,7 +893,11 @@ pthread_descr __pthread_find_self(void)
   /* __pthread_handles[0] is the initial thread, __pthread_handles[1] is
      the manager threads handled specially in thread_self(), so start at 2 */
   h = __pthread_handles + 2;
+# ifdef _STACK_GROWS_UP
+  while (! (sp >= (char *) h->h_descr && sp < h->h_descr->p_guardaddr)) h++;
+# else
   while (! (sp <= (char *) h->h_descr && sp >= h->h_bottom)) h++;
+# endif
   return h->h_descr;
 }
 
@@ -908,12 +912,23 @@ pthread_descr __pthread_self_stack(void)
     return manager_thread;
   h = __pthread_handles + 2;
 # ifdef USE_TLS
+#  ifdef _STACK_GROWS_UP
+  while (h->h_descr == NULL
+	 || ! (sp >= h->h_descr->p_stackaddr && sp < h->h_descr->p_guardaddr))
+    h++;
+#  else
   while (h->h_descr == NULL
 	 || ! (sp <= (char *) h->h_descr->p_stackaddr && sp >= h->h_bottom))
     h++;
+#  endif
 # else
+#  ifdef _STACK_GROWS_UP
+  while (! (sp >= (char *) h->h_descr && sp < h->h_descr->p_guardaddr))
+    h++;
+#  else
   while (! (sp <= (char *) h->h_descr && sp >= h->h_bottom))
     h++;
+#  endif
 # endif
   return h->h_descr;
 }