diff options
| author | Kamil Rytarowski <n54@gmx.com> | 2020-01-03 02:35:33 +0100 |
|---|---|---|
| committer | Kamil Rytarowski <n54@gmx.com> | 2020-01-03 02:40:52 +0100 |
| commit | 0da15ff318480f30bbc90b9e8ecb9bb9431c7fd3 (patch) | |
| tree | cbb028b9d2349fbfbc5dabc3b48bbe17c9f32f39 /compiler-rt/lib | |
| parent | 2c4620ad57b888be7aa571bdde1126ce49878f26 (diff) | |
| download | bcm5719-llvm-0da15ff318480f30bbc90b9e8ecb9bb9431c7fd3.tar.gz bcm5719-llvm-0da15ff318480f30bbc90b9e8ecb9bb9431c7fd3.zip | |
[compiler-rt] [netbsd] Switch to syscall for ThreadSelfTlsTcb()
This change avoids using internal, namespaced per-CPU calls that
are not a stable interface to read the TSL base value.
Diffstat (limited to 'compiler-rt/lib')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp index 56d4b71849c..edbe8402808 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp @@ -28,10 +28,6 @@ #include "sanitizer_placement_new.h" #include "sanitizer_procmaps.h" -#if SANITIZER_NETBSD -#define _RTLD_SOURCE // Fast LWP private pointer getters in ThreadSelfTlsTcb(). -#endif - #include <dlfcn.h> // for dlsym() #include <link.h> #include <pthread.h> @@ -54,6 +50,7 @@ #if SANITIZER_NETBSD #include <sys/sysctl.h> #include <sys/tls.h> +#include <lwp.h> #endif #if SANITIZER_SOLARIS @@ -403,13 +400,7 @@ uptr ThreadSelf() { #if SANITIZER_NETBSD static struct tls_tcb * ThreadSelfTlsTcb() { - struct tls_tcb * tcb; -# ifdef __HAVE___LWP_GETTCB_FAST - tcb = (struct tls_tcb *)__lwp_gettcb_fast(); -# elif defined(__HAVE___LWP_GETPRIVATE_FAST) - tcb = (struct tls_tcb *)__lwp_getprivate_fast(); -# endif - return tcb; + return (struct tls_tcb *)_lwp_getprivate(); } uptr ThreadSelf() { |

