[all-commits] [llvm/llvm-project] e67259: [sanitizer] Let glibc aarch64 use O(1) GetTls

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue May 25 16:28:33 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e67259531d7385fece6873b1da57e7cf84f110b3
      https://github.com/llvm/llvm-project/commit/e67259531d7385fece6873b1da57e7cf84f110b3
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-05-25 (Tue, 25 May 2021)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp

  Log Message:
  -----------
  [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.




More information about the All-commits mailing list