[all-commits] [llvm/llvm-project] 90678f: [GWP-ASan] Abstract the thread local variables access

Kostya Kortchinsky via All-commits all-commits at lists.llvm.org
Wed Oct 28 15:07:04 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 90678f65ae47523586bd34392ed3cd1369cf5e9b
      https://github.com/llvm/llvm-project/commit/90678f65ae47523586bd34392ed3cd1369cf5e9b
  Author: Kostya Kortchinsky <kostyak at google.com>
  Date:   2020-10-28 (Wed, 28 Oct 2020)

  Changed paths:
    M compiler-rt/lib/gwp_asan/CMakeLists.txt
    M compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp
    M compiler-rt/lib/gwp_asan/guarded_pool_allocator.h
    M compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_posix.cpp
    A compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_tls.h
    M compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp
    M compiler-rt/lib/gwp_asan/utilities.cpp

  Log Message:
  -----------
  [GWP-ASan] Abstract the thread local variables access

In a similar fashion to D87420 for Scudo, this CL introduces a way to
get thread local variables via a platform-specific reserved TLS slot,
since Fuchsia doesn't support ELF TLS from the libc itself.

If needing to use this, a platform will have to define
`GWP_ASAN_HAS_PLATFORM_TLS_SLOT` and provide `gwp_asan_platform_tls_slot.h`
which will define a `uint64_t *getPlatformGwpAsanTlsSlot()` function
that will return the TLS word of storage.

I snuck in a couple of cleanup items as well, moving some static
functions to anonymous namespace for consistency.

Differential Revision: https://reviews.llvm.org/D90195




More information about the All-commits mailing list