[compiler-rt] r245773 - [asan] Don't apply glibc-specific TLS calculations on Android.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 17:47:13 PDT 2015


Author: eugenis
Date: Fri Aug 21 19:47:12 2015
New Revision: 245773

URL: http://llvm.org/viewvc/llvm-project?rev=245773&view=rev
Log:
[asan] Don't apply glibc-specific TLS calculations on Android.

This fixes an infinite recursion between GetTls and GetTlsSize on
Android-x86.


Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc?rev=245773&r1=245772&r2=245773&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc Fri Aug 21 19:47:12 2015
@@ -326,7 +326,7 @@ uptr ThreadSelf() {
 
 #if !SANITIZER_GO
 static void GetTls(uptr *addr, uptr *size) {
-#if SANITIZER_LINUX
+#if SANITIZER_LINUX && !SANITIZER_ANDROID
 # if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__)
   *addr = ThreadSelf();
   *size = GetTlsSize();
@@ -352,6 +352,9 @@ static void GetTls(uptr *addr, uptr *siz
     *addr = (uptr) dtv[2];
     *size = (*addr == 0) ? 0 : ((uptr) segbase[0] - (uptr) dtv[2]);
   }
+#elif SANITIZER_ANDROID
+  *addr = 0;
+  *size = 0;
 #else
 # error "Unknown OS"
 #endif




More information about the llvm-commits mailing list