[PATCH] D104248: [compiler-rt][hwasan] Move Thread::Init into hwasan_linux.cpp

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 14 11:18:52 PDT 2021


leonardchan created this revision.
leonardchan added reviewers: eugenis, vitalybuka, pcc.
leonardchan added a project: Sanitizers.
Herald added a subscriber: dberris.
leonardchan requested review of this revision.
Herald added a subscriber: Sanitizers.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104248

Files:
  compiler-rt/lib/hwasan/hwasan_linux.cpp
  compiler-rt/lib/hwasan/hwasan_thread.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104248.351937.patch
Type: text/x-patch
Size: 3809 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210614/3976d349/attachment.bin>


More information about the cfe-commits mailing list