about summary refs log tree commit diff
path: root/sysdeps/generic/libc-start.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-08-05 06:38:00 +0000
committerRoland McGrath <roland@gnu.org>2002-08-05 06:38:00 +0000
commita162642d80973c1ca52bf58e0d776060d9746d75 (patch)
tree896f7a166c18e6beb1d9780adbc86727e586a907 /sysdeps/generic/libc-start.c
parent2a185b31a8e3a50fc5fccadfe3c1f7110686baca (diff)
downloadglibc-a162642d80973c1ca52bf58e0d776060d9746d75.tar.gz
glibc-a162642d80973c1ca52bf58e0d776060d9746d75.tar.xz
glibc-a162642d80973c1ca52bf58e0d776060d9746d75.zip
* sysdeps/generic/libc-tls.c (__libc_setup_tls): Make the phdr loop
	actually iterate over the elements.  Fix typo p_type -> p_vaddr.

	* include/pthread.h: Don't declare __pthread_initialize_minimal as
	weak here; we declare it weak or strong in the one place we use it.
	* sysdeps/generic/libc-start.c: ... which is here.
	Don't make the decl weak if [USE_TLS], since static programs need TLS
	setup even when single-threaded.
Diffstat (limited to 'sysdeps/generic/libc-start.c')
-rw-r--r--sysdeps/generic/libc-start.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/generic/libc-start.c b/sysdeps/generic/libc-start.c
index 600136dae5..8d523e6836 100644
--- a/sysdeps/generic/libc-start.c
+++ b/sysdeps/generic/libc-start.c
@@ -30,7 +30,12 @@ extern int __libc_multiple_libcs;
 extern void *__libc_stack_end;
 
 #ifndef SHARED
-extern void __pthread_initialize_minimal (void) __attribute__ ((weak));
+# include <tls.h>
+extern void __pthread_initialize_minimal (void)
+# if !(USE_TLS - 0)
+     __attribute__ ((weak))
+# endif
+     ;
 #endif
 
 
@@ -91,7 +96,7 @@ BP_SYM (__libc_start_main) (int (*main) (int, char **, char **),
      we need to setup errno.  If there is no thread library and we
      handle TLS the function is defined in the libc to initialized the
      TLS handling.  */
-# ifndef TLS
+# if !(USE_TLS - 0)
   if (__pthread_initialize_minimal)
 # endif
     __pthread_initialize_minimal ();