summaryrefslogtreecommitdiff
path: root/pthread/pt-internal.h
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-02-28 21:41:47 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-02-28 21:41:47 +0100
commit3410beff94994edf971dd634c56156d70c7cf215 (patch)
treec4863bee433442f55eb0b36cf809eff93adcc52e /pthread/pt-internal.h
parente5107f3250800f5194c6fae4050eb3ea7f61209d (diff)
Allow libpthread.so to dynamically loaded from a dlopened library
* pthread/pt-internal.h: Include <ldsodefs.h> (_dl_allocate_tls, _dl_deallocate_tls): Remove declarations. * sysdeps/mach/hurd/pt-sysdep.c (init_routine): Rename into _init_routine, add `stack' parameter, return if __pthread_threads is already initialized, pass stack address to __pthread_create_internal if any. (init_routine): New function, calls init_routine with 0 (dynamic_init_routine): New constructor function, calls init_routine with __libc_stack_end.
Diffstat (limited to 'pthread/pt-internal.h')
-rw-r--r--pthread/pt-internal.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/pthread/pt-internal.h b/pthread/pt-internal.h
index 84964bf..18b5b4c 100644
--- a/pthread/pt-internal.h
+++ b/pthread/pt-internal.h
@@ -35,6 +35,10 @@
#include <pt-sysdep.h>
#include <pt-machdep.h>
+#if IS_IN (libpthread)
+# include <ldsodefs.h>
+#endif
+
/* Thread state. */
enum pthread_state
{
@@ -323,17 +327,4 @@ const struct __pthread_rwlockattr __pthread_default_rwlockattr;
/* Default condition attributes. */
const struct __pthread_condattr __pthread_default_condattr;
-
-#ifdef ENABLE_TLS
-
-/* From glibc. */
-
-/* Dynamic linker TLS allocation. */
-extern void *_dl_allocate_tls(void *);
-
-/* Dynamic linker TLS deallocation. */
-extern void _dl_deallocate_tls(void *, int);
-
-#endif /* ENABLE_TLS */
-
#endif /* pt-internal.h */