Reserve TLS_SLOT_SANITIZER with value 6.
This slot will replace TLS_SLOT_TSAN, which needs to be removed for ELF
TLS compatibility. The platform has both slots reserved until compiler-rt
can be updated. See:
- https://reviews.llvm.org/D53906
- discussion on AOSP change Idf25d2ee457a5d26d0bdd6281cee72c345c8b755
Bug: http://b/78026329
Test: m
Change-Id: Ifd5aeb5711dc88266e7350cb022146dd87cfd7be
diff --git a/libc/private/bionic_tls.h b/libc/private/bionic_tls.h
index da5a0e0..4749cee 100644
--- a/libc/private/bionic_tls.h
+++ b/libc/private/bionic_tls.h
@@ -66,7 +66,9 @@
TLS_SLOT_STACK_GUARD = 5, // GCC requires this specific slot for x86.
- // TLS slot 6 was used for dlerror but is now free.
+ // Lets sanitizers avoid using pthread_getspecific for finding the current
+ // thread state. (Slot 6 was historically used for dlerror instead.)
+ TLS_SLOT_SANITIZER = 6,
// Fast storage for Thread::Current() in ART.
TLS_SLOT_ART_THREAD_SELF = 7,