[sanitizer] Let glibc aarch64 use O(1) GetTls
authorFangrui Song <i@maskray.me>
Tue, 25 May 2021 23:28:17 +0000 (16:28 -0700)
committerFangrui Song <i@maskray.me>
Tue, 25 May 2021 23:28:17 +0000 (16:28 -0700)
commite67259531d7385fece6873b1da57e7cf84f110b3
tree7f8930a9483c3eded311399c26dcc663f74cb9bf
parent52ac1147713db35f6ff644fc8a40f08944ce3292
[sanitizer] Let glibc aarch64 use O(1) GetTls

The generic approach can still be used by musl and FreeBSD. Note: on glibc
2.31, TLS_PRE_TCB_SIZE is 0x700, larger than ThreadDescriptorSize() by 16, but
this is benign: as long as the range includes pthread::{specific_1stblock,specific}
pthread_setspecific will not cause false positives.

Note: the state before afec953857ffd682cb4119e7950f3593efbaaa81 underestimated
the TLS size a lot (nearly ThreadDescriptorSize() = 1776).
That may explain why afec953857ffd682cb4119e7950f3593efbaaa81 actually made some
tests pass.
compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp