about summary refs log tree commit diff
path: root/elf/dl-tls_init_tp.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-tls_init_tp.c')
-rw-r--r--elf/dl-tls_init_tp.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/elf/dl-tls_init_tp.c b/elf/dl-tls_init_tp.c
index 728cd84c00..d84adc992c 100644
--- a/elf/dl-tls_init_tp.c
+++ b/elf/dl-tls_init_tp.c
@@ -18,6 +18,35 @@
 
 #include <ldsodefs.h>
 
+#if defined SHARED && defined _LIBC_REENTRANT \
+    && defined __rtld_lock_default_lock_recursive
+static void
+rtld_lock_default_lock_recursive (void *lock)
+{
+  __rtld_lock_default_lock_recursive (lock);
+}
+
+static void
+rtld_lock_default_unlock_recursive (void *lock)
+{
+  __rtld_lock_default_unlock_recursive (lock);
+}
+#endif
+
+void
+__tls_pre_init_tp (void)
+{
+#if !THREAD_GSCOPE_IN_TCB
+  GL(dl_init_static_tls) = &_dl_nothread_init_static_tls;
+#endif
+
+#if defined SHARED && defined _LIBC_REENTRANT \
+    && defined __rtld_lock_default_lock_recursive
+  GL(dl_rtld_lock_recursive) = rtld_lock_default_lock_recursive;
+  GL(dl_rtld_unlock_recursive) = rtld_lock_default_unlock_recursive;
+#endif
+}
+
 void
 __tls_init_tp (void)
 {