[all-commits] [llvm/llvm-project] 88d939: [compiler-rt][hwasan] Move Thread::Init into hwasa...

Leonard Chan via All-commits all-commits at lists.llvm.org
Fri Jun 18 10:36:35 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 88d93923e6653f02f5ece1faf9f49a7e309989a0
      https://github.com/llvm/llvm-project/commit/88d93923e6653f02f5ece1faf9f49a7e309989a0
  Author: Leonard Chan <leonardchan at google.com>
  Date:   2021-06-18 (Fri, 18 Jun 2021)

  Changed paths:
    M compiler-rt/lib/hwasan/hwasan_linux.cpp
    M compiler-rt/lib/hwasan/hwasan_thread.cpp
    M compiler-rt/lib/hwasan/hwasan_thread.h

  Log Message:
  -----------
  [compiler-rt][hwasan] Move Thread::Init into hwasan_linux.cpp

This allows for other implementations to define their own version of `Thread::Init`.
This will be the case for Fuchsia where much of the thread initialization can be
broken up between different thread hooks (`__sanitizer_before_thread_create_hook`,
`__sanitizer_thread_create_hook`, `__sanitizer_thread_start_hook`). Namely, setting
up the heap ring buffer and stack info and can be setup before thread creation.
The stack ring buffer can also be setup before thread creation, but storing it into
`__hwasan_tls` can only be done on the thread start hook since it's only then we
can access `__hwasan_tls` for that thread correctly.

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




More information about the All-commits mailing list