summaryrefslogtreecommitdiff
path: root/lib/scudo/scudo_tls_linux.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-08 17:13:22 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-08 17:13:22 +0000
commit2109e2e4181555140883e9ec46807746a0eabad2 (patch)
tree81e6d3c4fac52ac6256179942b7f365d01b084d6 /lib/scudo/scudo_tls_linux.cpp
parent285f392c555459b82baeec68b944936685546972 (diff)
Diffstat (limited to 'lib/scudo/scudo_tls_linux.cpp')
-rw-r--r--lib/scudo/scudo_tls_linux.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/scudo/scudo_tls_linux.cpp b/lib/scudo/scudo_tls_linux.cpp
index 3453367f8a53..5a9cc998bccf 100644
--- a/lib/scudo/scudo_tls_linux.cpp
+++ b/lib/scudo/scudo_tls_linux.cpp
@@ -14,7 +14,7 @@
#include "sanitizer_common/sanitizer_platform.h"
-#if SANITIZER_LINUX
+#if SANITIZER_LINUX && !SANITIZER_ANDROID
#include "scudo_tls.h"
@@ -26,8 +26,10 @@ namespace __scudo {
static pthread_once_t GlobalInitialized = PTHREAD_ONCE_INIT;
static pthread_key_t PThreadKey;
-thread_local ThreadState ScudoThreadState = ThreadNotInitialized;
-thread_local ScudoThreadContext ThreadLocalContext;
+__attribute__((tls_model("initial-exec")))
+THREADLOCAL ThreadState ScudoThreadState = ThreadNotInitialized;
+__attribute__((tls_model("initial-exec")))
+THREADLOCAL ScudoThreadContext ThreadLocalContext;
static void teardownThread(void *Ptr) {
uptr Iteration = reinterpret_cast<uptr>(Ptr);
@@ -59,4 +61,4 @@ void initThread() {
} // namespace __scudo
-#endif // SANITIZER_LINUX
+#endif // SANITIZER_LINUX && !SANITIZER_ANDROID