summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_spec.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2006-03-13 00:59:51 +0000
committerdeischen <deischen@FreeBSD.org>2006-03-13 00:59:51 +0000
commitcc69a08fbfbd64dd13ebb80b18cc83824a3c8781 (patch)
tree0ff38bc0c45640883ff06a668902f099c9ff8641 /lib/libpthread/thread/thr_spec.c
parent11cbb2f2752487f0605f14afcc37e520331c8dbc (diff)
downloadFreeBSD-src-cc69a08fbfbd64dd13ebb80b18cc83824a3c8781.zip
FreeBSD-src-cc69a08fbfbd64dd13ebb80b18cc83824a3c8781.tar.gz
Add compatibility symbol maps. libpthread (.so.1 and .so.2)
used LIBTHREAD_1_0 as its version definition, but now needs to define its symbols in the same namespace used by libc. The compatibility hooks allows you to use libraries and binaries built and linked to libpthread before libc was built with symbol versioning. The shims can be removed if libpthread is given a version bump. Reviewed by: davidxu
Diffstat (limited to 'lib/libpthread/thread/thr_spec.c')
-rw-r--r--lib/libpthread/thread/thr_spec.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_spec.c b/lib/libpthread/thread/thr_spec.c
index 6c2b636..f6e8861 100644
--- a/lib/libpthread/thread/thr_spec.c
+++ b/lib/libpthread/thread/thr_spec.c
@@ -36,11 +36,27 @@
#include <string.h>
#include <errno.h>
#include <pthread.h>
+
#include "thr_private.h"
-/* Static variables: */
+
struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX];
+/*
+ * XXX - This breaks the linker if LT10_COMPAT_DEFAULT doesn't
+ * also include a weak reference to the default symbol.
+ */
+LT10_COMPAT_PRIVATE(_thread_keytable);
+
+LT10_COMPAT_PRIVATE(_pthread_key_create);
+LT10_COMPAT_DEFAULT(pthread_key_create);
+LT10_COMPAT_PRIVATE(_pthread_key_delete);
+LT10_COMPAT_DEFAULT(pthread_key_delete);
+LT10_COMPAT_PRIVATE(_pthread_getspecific);
+LT10_COMPAT_DEFAULT(pthread_getspecific);
+LT10_COMPAT_PRIVATE(_pthread_setspecific);
+LT10_COMPAT_DEFAULT(pthread_setspecific);
+
__weak_reference(_pthread_key_create, pthread_key_create);
__weak_reference(_pthread_key_delete, pthread_key_delete);
__weak_reference(_pthread_getspecific, pthread_getspecific);
OpenPOWER on IntegriCloud