[compiler-rt] r246148 - [compiler-rt] [tsan] Fix GetTls for aarch64
Adhemerval Zanella via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 06:11:00 PDT 2015
Author: azanella
Date: Thu Aug 27 08:11:00 2015
New Revision: 246148
URL: http://llvm.org/viewvc/llvm-project?rev=246148&view=rev
Log:
[compiler-rt] [tsan] Fix GetTls for aarch64
This patch fix the function GetTls for aarch64, where it assumes it
follows the x86_64 way where the TLS initial address is at the end
of TLS. Instead aarch64 set the TLS address as the thread pointer.
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=246148&r1=246147&r2=246148&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc Thu Aug 27 08:11:00 2015
@@ -327,12 +327,12 @@ uptr ThreadSelf() {
#if !SANITIZER_GO
static void GetTls(uptr *addr, uptr *size) {
#if SANITIZER_LINUX && !SANITIZER_ANDROID
-# if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__)
+# if defined(__x86_64__) || defined(__i386__)
*addr = ThreadSelf();
*size = GetTlsSize();
*addr -= *size;
*addr += ThreadDescriptorSize();
-# elif defined(__mips__)
+# elif defined(__mips__) || defined(__aarch64__)
*addr = ThreadSelf();
*size = GetTlsSize();
# else
More information about the llvm-commits
mailing list