diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-08-13 19:57:11 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-08-13 19:57:11 +0000 |
commit | d4c85de1690b4aab11fe1d76a039e0fac81f90f6 (patch) | |
tree | 66394d23f5f27fbc56320f91c2246dd3a2936999 /include | |
parent | 429538f5a32df0890e5a997fce6e1411794b77bf (diff) | |
download | compiler-rt-d4c85de1690b4aab11fe1d76a039e0fac81f90f6.tar.gz |
[hwasan] Allow optional early shadow setup.
Summary:
Provide __hwasan_shadow_init that can be used to initialize shadow w/o touching libc.
It can be used to bootstrap an unusual case of fully-static executable with
hwasan-instrumented libc, which needs to run hwasan code before it is ready to serve
user calls like madvise().
Reviewers: vitalybuka, kcc
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D50581
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@339606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/sanitizer/hwasan_interface.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sanitizer/hwasan_interface.h b/include/sanitizer/hwasan_interface.h index 0c306cf27..7f0d36f71 100644 --- a/include/sanitizer/hwasan_interface.h +++ b/include/sanitizer/hwasan_interface.h @@ -19,6 +19,12 @@ #ifdef __cplusplus extern "C" { #endif + // Initialize shadow but not the rest of the runtime. + // Does not call libc unless there is an error. + // Can be called multiple times, or not at all (in which case shadow will + // be initialized in compiler-inserted __hwasan_init() call). + void __hwasan_shadow_init(void); + // This function may be optionally provided by user and should return // a string containing HWASan runtime options. See asan_flags.h for details. const char* __hwasan_default_options(void); |