[compiler-rt] r200463 - [asan] re-enable __tls_get_addr interceptor with a proper fix (use __attribute__((tls_model(initial-exec))))

Kostya Serebryany kcc at google.com
Thu Jan 30 01:25:49 PST 2014


Author: kcc
Date: Thu Jan 30 03:25:48 2014
New Revision: 200463

URL: http://llvm.org/viewvc/llvm-project?rev=200463&view=rev
Log:
[asan] re-enable __tls_get_addr interceptor with a proper fix (use __attribute__((tls_model(initial-exec))))

Modified:
    compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/stress_dtls.c
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_tls_get_addr.cc

Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/stress_dtls.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/stress_dtls.c?rev=200463&r1=200462&r2=200463&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/stress_dtls.c (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/stress_dtls.c Thu Jan 30 03:25:48 2014
@@ -1,5 +1,3 @@
-// Currently broken...
-// XFAIL: *
 // REQUIRES: asan-64-bits
 // Stress test dynamic TLS + dlopen + threads.
 //

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h?rev=200463&r1=200462&r2=200463&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h Thu Jan 30 03:25:48 2014
@@ -177,6 +177,6 @@
 #define SANITIZER_INTERCEPT_PTHREAD_COND SI_NOT_WINDOWS
 #define SANITIZER_INTERCEPT_PTHREAD_SETNAME_NP SI_LINUX_NOT_ANDROID
 
-#define SANITIZER_INTERCEPT_TLS_GET_ADDR 0  // SI_LINUX_NOT_ANDROID
+#define SANITIZER_INTERCEPT_TLS_GET_ADDR SI_LINUX_NOT_ANDROID
 
 #endif  // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_tls_get_addr.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_tls_get_addr.cc?rev=200463&r1=200462&r2=200463&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_tls_get_addr.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_tls_get_addr.cc Thu Jan 30 03:25:48 2014
@@ -33,8 +33,8 @@ struct Glibc_2_19_tls_header {
   uptr start;
 };
 
-// This must be static TLS, i.e. the run-time should be build with
-// -ftls-model=initial-exec or equivalent.
+// This must be static TLS
+__attribute__((tls_model("initial-exec")))
 static __thread DTLS dtls;
 
 // Make sure we properly destroy the DTLS objects:





More information about the llvm-commits mailing list