[PATCH] D55581: Switch Android from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER(6)

Ryan Prichard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 11 14:26:41 PST 2018


rprichard created this revision.
Herald added subscribers: Sanitizers, llvm-commits, delcypher, kristof.beyls, javed.absar, kubamracek, srhines.

The TLS_SLOT_TSAN slot is available starting in N, but its location (8)
is incompatible with the proposed solution for implementing ELF TLS on
Android (i.e. bump ARM/AArch64 alignment to reserve an 8-word TCB).

Instead, starting in Q, Bionic replaced TLS_SLOT_DLERROR(6) with
TLS_SLOT_SANITIZER(6). Switch compiler-rt to the new slot.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D55581

Files:
  lib/sanitizer_common/sanitizer_linux.h


Index: lib/sanitizer_common/sanitizer_linux.h
===================================================================
--- lib/sanitizer_common/sanitizer_linux.h
+++ lib/sanitizer_common/sanitizer_linux.h
@@ -134,13 +134,13 @@
 #error "Unsupported architecture."
 #endif
 
-// The Android Bionic team has allocated a TLS slot for TSan starting with N,
-// given that Android currently doesn't support ELF TLS. It is used to store
-// Sanitizers thread specific data.
-static const int TLS_SLOT_TSAN = 8;
+// The Android Bionic team has allocated a TLS slot for sanitizers starting
+// with Q, given that Android currently doesn't support ELF TLS. It is used to
+// store sanitizer thread specific data.
+static const int TLS_SLOT_SANITIZER = 6;
 
 ALWAYS_INLINE uptr *get_android_tls_ptr() {
-  return reinterpret_cast<uptr *>(&__get_tls()[TLS_SLOT_TSAN]);
+  return reinterpret_cast<uptr *>(&__get_tls()[TLS_SLOT_SANITIZER]);
 }
 
 #endif  // SANITIZER_ANDROID


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55581.177784.patch
Type: text/x-patch
Size: 957 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181211/a869ad24/attachment.bin>


More information about the llvm-commits mailing list