aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-07-23 23:12:01 +0000
committerUlrich Drepper <drepper@redhat.com>2002-07-23 23:12:01 +0000
commit8a30f00fe8ea30054c2df183d34ef3ad8a522cc5 (patch)
tree4b34500fac3e847c4f98bec8ca6c0ab96f7704ba /linuxthreads
parentfcda29e2604e941cbe9a9eb30c56b8b8fa607836 (diff)
downloadglibc-8a30f00fe8ea30054c2df183d34ef3ad8a522cc5.zip
glibc-8a30f00fe8ea30054c2df183d34ef3ad8a522cc5.tar.gz
glibc-8a30f00fe8ea30054c2df183d34ef3ad8a522cc5.tar.bz2
Update.
2002-07-23 Ulrich Drepper <drepper@redhat.com> * sysdeps/generic/libc-tls.c: New file. * csu/Makefile (routines): Add libc-tls. (static-only-routines): Add libc-tls. * elf/dl-support.c (_dl_phdr): New variable. (_dl_phnum): New variable. (_dl_aux_init): Initialize _dl_phdr and _dl_phnum from aux vector. * sysdeps/generic/libc-start.c (__libc_start_main): Reorganize code for !SHARED. First look through auxiliary vector. If TLS always call __pthread_initialize_minimal. * sysdeps/generic/dl-tls.c (_dl_allocate_tls): Make sure size argument in mmap call is never zero.
Diffstat (limited to 'linuxthreads')
-rw-r--r--linuxthreads/ChangeLog6
-rw-r--r--linuxthreads/Examples/tststatic.c1
-rw-r--r--linuxthreads/pthread.c15
3 files changed, 20 insertions, 2 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 3b87581..95feff2 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,6 +1,10 @@
2002-07-22 Ulrich Drepper <drepper@redhat.com>
- * Makefile: Actually creat tst-signal.out file when running the test.
+ * pthread.c (__pthread_initialize_minimal): If !SHARED and TLS
+ call __libc_setup_tls first.
+ * Makefile: Actually create tst-signal.out file when running the test.
+ (tests): Add tststatic.
+ * Examples/tststatic.c: New file.
2002-07-19 Ulrich Drepper <drepper@redhat.com>
diff --git a/linuxthreads/Examples/tststatic.c b/linuxthreads/Examples/tststatic.c
new file mode 100644
index 0000000..421011a
--- /dev/null
+++ b/linuxthreads/Examples/tststatic.c
@@ -0,0 +1 @@
+#include "ex1.c"
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index 12ce38b..8bca63e 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -394,13 +394,26 @@ extern void *__dso_handle __attribute__ ((weak));
#endif
+#if defined USE_TLS && !defined SHARED
+extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
+#endif
+
+
/* Do some minimal initialization which has to be done during the
startup of the C library. */
void
__pthread_initialize_minimal(void)
{
#ifdef USE_TLS
- pthread_descr self = THREAD_SELF;
+ pthread_descr self;
+
+# ifndef SHARED
+ /* Unlike in the dynamically linked case the dynamic linker has not
+ taken care of initializing the TLS data structures. */
+ __libc_setup_tls (TLS_TCB_SIZE, TLS_TCB_ALIGN);
+# endif
+
+ self = THREAD_SELF;
/* The memory for the thread descriptor was allocated elsewhere as
part of the TLS allocation. We have to initialize the data