[PATCH] D12394: [compiler-rt] [tsan] Fix GetTls for aarch64
Adhemerval Zanella via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 18:13:29 PDT 2015
zatrazz created this revision.
zatrazz added reviewers: kcc, eugenis, pcc, dvyukov, rengolin.
zatrazz added a subscriber: llvm-commits.
Herald added subscribers: rengolin, aemerson.
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.
http://reviews.llvm.org/D12394
Files:
lib/sanitizer_common/sanitizer_linux_libcdep.cc
Index: lib/sanitizer_common/sanitizer_linux_libcdep.cc
===================================================================
--- lib/sanitizer_common/sanitizer_linux_libcdep.cc
+++ lib/sanitizer_common/sanitizer_linux_libcdep.cc
@@ -327,12 +327,12 @@
#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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12394.33291.patch
Type: text/x-patch
Size: 714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150827/bc0f629c/attachment.bin>
More information about the llvm-commits
mailing list