about summary refs log tree commit diff
path: root/elf/soinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/soinit.c')
-rw-r--r--elf/soinit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/elf/soinit.c b/elf/soinit.c
index 1dee73c3be..7db054e4d4 100644
--- a/elf/soinit.c
+++ b/elf/soinit.c
@@ -40,6 +40,9 @@ extern void __deregister_frame (const void *);
 # endif
 #endif
 
+/* We have to initialize the thread library at least if bit.  */
+extern void __pthread_initialize_minimal (void) __attribute__ ((weak));
+
 /* This function will be called from _init in init-first.c.  */
 void
 __libc_global_ctors (void)
@@ -48,6 +51,11 @@ __libc_global_ctors (void)
   run_hooks (__CTOR_LIST__);
 #ifdef HAVE_DWARF2_UNWIND_INFO
 # ifdef HAVE_DWARF2_UNWIND_INFO_STATIC
+  /* Initialize the thread library at least a bit since the libgcc functions
+     are using thread functions if these are available.  */
+  if (__pthread_initialize_minimal)
+    __pthread_initialize_minimal ();
+
   {
     static struct object ob;
     __register_frame_info (__EH_FRAME_BEGIN__, &ob);