summaryrefslogtreecommitdiffstats
path: root/lib/libkse/support
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2003-05-30 00:21:52 +0000
committerkan <kan@FreeBSD.org>2003-05-30 00:21:52 +0000
commita22cad65ccb9cfd81c057db83cc2c7c2cb5ae79d (patch)
tree94d7f73e2932ac623f1590991875a38731aca104 /lib/libkse/support
parent51dd2dd2b3fe2cc5a81d2a41ffc4166698a4b22f (diff)
downloadFreeBSD-src-a22cad65ccb9cfd81c057db83cc2c7c2cb5ae79d.zip
FreeBSD-src-a22cad65ccb9cfd81c057db83cc2c7c2cb5ae79d.tar.gz
Attempt to eliminate PLT relocations from rwlock aquire/release
path, making them suitable for direct use by the dynamic loader. Register libpthread-specific locking API with rtld on startup. This still has some rough edges with signals which should be addresses later. Approved by: re (scottl)
Diffstat (limited to 'lib/libkse/support')
-rw-r--r--lib/libkse/support/Makefile.inc10
-rw-r--r--lib/libkse/support/thr_support.c55
2 files changed, 65 insertions, 0 deletions
diff --git a/lib/libkse/support/Makefile.inc b/lib/libkse/support/Makefile.inc
new file mode 100644
index 0000000..27f6524
--- /dev/null
+++ b/lib/libkse/support/Makefile.inc
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/support
+
+SRCS += thr_support.c
+SOBJS+= thr_libc.So
+
+thr_libc.So: thr_support.So
+ ${CC} -nostdlib -L/usr/lib -o ${.TARGET} -Wl,-x,-r ${.ALLSRC} -lc_pic
+
diff --git a/lib/libkse/support/thr_support.c b/lib/libkse/support/thr_support.c
new file mode 100644
index 0000000..7ffa5d7
--- /dev/null
+++ b/lib/libkse/support/thr_support.c
@@ -0,0 +1,55 @@
+/*-
+ * Copyright 2003 Alexander Kabaev.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/kse.h>
+#include <signal.h>
+#include <string.h>
+
+__strong_reference(clock_gettime, _thr_clock_gettime);
+__strong_reference(kse_exit, _thr_kse_exit);
+__strong_reference(kse_wakeup, _thr_kse_wakeup);
+__strong_reference(kse_create, _thr_kse_create);
+__strong_reference(kse_thr_interrupt, _thr_kse_thr_interrupt);
+__strong_reference(kse_release, _thr_kse_release);
+
+__strong_reference(sigaction, _thr_sigaction);
+__strong_reference(sigprocmask, _thr_sigprocmask);
+__strong_reference(sigemptyset, _thr_sigemptyset);
+__strong_reference(sigaddset, _thr_sigaddset);
+__strong_reference(sigfillset, _thr_sigfillset);
+__strong_reference(sigismember, _thr_sigismember);
+__strong_reference(sigdelset, _thr_sigdelset);
+
+__strong_reference(memset, _thr_memset);
+__strong_reference(memcpy, _thr_memcpy);
+__strong_reference(strcpy, _thr_strcpy);
+__strong_reference(strlen, _thr_strlen);
+__strong_reference(bzero, _thr_bzero);
+
OpenPOWER on IntegriCloud