summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/thread/thr_init.c')
-rw-r--r--lib/libpthread/thread/thr_init.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c
index d044063..6139935 100644
--- a/lib/libpthread/thread/thr_init.c
+++ b/lib/libpthread/thread/thr_init.c
@@ -202,6 +202,18 @@ _thread_main(int argc, char *argv[], char *env)
_thread_init();
return (main(argc, argv, env));
}
+#else
+/*
+ * Force our auto-initialization module to be pulled in from the library,
+ * by referencing a symbol that is defined in it.
+ *
+ * The auto-initialization module is a small C++ module. It has a static
+ * constructor that calls _thread_init() automatically, at the beginning
+ * of program execution. That eliminates the need for any special hooks
+ * in crt0.o.
+ */
+extern int _thread_autoinit_dummy_decl;
+static int *_thread_autoinit_dummy_ref = &_thread_autoinit_dummy_decl;
#endif
#else
/*
OpenPOWER on IntegriCloud