summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2003-06-04 08:23:05 +0000
committermtm <mtm@FreeBSD.org>2003-06-04 08:23:05 +0000
commitb81589c925d4fe6bcf4f859228fa2824c76f1ca7 (patch)
treeb0bd92f950b7e438a2a5bca06ecfb76e6ae06f22 /lib/libthr
parent96c48e263583f7057ab5d63d6935d08098e68e2b (diff)
downloadFreeBSD-src-b81589c925d4fe6bcf4f859228fa2824c76f1ca7.zip
FreeBSD-src-b81589c925d4fe6bcf4f859228fa2824c76f1ca7.tar.gz
Make C applications statically compiled with libthr work. Previously,
an application compiled -static with libthr would dump core in malloc(3) because the stub thread initialization routine in libc would be used instead of the libthr supplied one.
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/thread/thr_init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c
index 9c334da..c404651 100644
--- a/lib/libthr/thread/thr_init.c
+++ b/lib/libthr/thread/thr_init.c
@@ -66,6 +66,8 @@
#include "thr_private.h"
+extern void _thread_init_hack(void);
+
/*
* All weak references used within libc should be in this table.
* This will is so that static libraries will work.
@@ -73,6 +75,8 @@
* XXXTHR - Check this list.
*/
static void *references[] = {
+ &_thread_init_hack,
+ &_thread_init,
&_accept,
&_bind,
&_close,
@@ -135,6 +139,8 @@ static void *references[] = {
* libraries, then the actual functions will not be loaded.
*/
static void *libgcc_references[] = {
+ &_thread_init_hack,
+ &_thread_init,
&_pthread_once,
&_pthread_key_create,
&_pthread_key_delete,
OpenPOWER on IntegriCloud