summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2017-12-06 01:16:49 +0000
committerKamil Rytarowski <n54@gmx.com>2017-12-06 01:16:49 +0000
commit4d7162ccfc83df44287abb7753d198d77ce22e5a (patch)
tree71dfcff15f3f3b30d3ccc399cb3452f6db415a35 /lib
parent2d5fd854fbbecd11eca767a2e46ca693848a3e5f (diff)
Support pthread_key_create symbol alias in MSan/NetBSD
Summary: NetBSD uses indirection symbol for a set of threading functions. Add alias to handle __libc_thr_keycreate the same way as pthread_key_create. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40767 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/msan/msan_interceptors.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/msan/msan_interceptors.cc b/lib/msan/msan_interceptors.cc
index 8d59a2ae6..19bc6ffa1 100644
--- a/lib/msan/msan_interceptors.cc
+++ b/lib/msan/msan_interceptors.cc
@@ -1085,6 +1085,11 @@ INTERCEPTOR(int, pthread_key_create, __sanitizer_pthread_key_t *key,
return res;
}
+#if SANITIZER_NETBSD
+INTERCEPTOR(void, __libc_thr_keycreate, void *m, void (*dtor)(void *value)) \
+ ALIAS(WRAPPER_NAME(pthread_key_create));
+#endif
+
INTERCEPTOR(int, pthread_join, void *th, void **retval) {
ENSURE_MSAN_INITED();
int res = REAL(pthread_join)(th, retval);
@@ -1634,6 +1639,11 @@ void InitializeInterceptors() {
INTERCEPT_FUNCTION(pthread_create);
#endif
INTERCEPT_FUNCTION(pthread_key_create);
+
+#if SANITIZER_NETBSD
+ INTERCEPT_FUNCTION(__libc_thr_keycreate);
+#endif
+
INTERCEPT_FUNCTION(pthread_join);
INTERCEPT_FUNCTION(tzset);
INTERCEPT_FUNCTION(__cxa_atexit);