summaryrefslogtreecommitdiff
path: root/compiler-rt/include
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2018-08-13 19:57:11 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2018-08-13 19:57:11 +0000
commit1fe8c358d04c6fcdd9d573cc435b66f12fc2994c (patch)
tree127e855409fb373f2e096e0d72d85533b6a0feed /compiler-rt/include
parentdc38045c58f36f0888d8bf4884c5b5c68c7f8e61 (diff)
[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
Diffstat (limited to 'compiler-rt/include')
-rw-r--r--compiler-rt/include/sanitizer/hwasan_interface.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/include/sanitizer/hwasan_interface.h b/compiler-rt/include/sanitizer/hwasan_interface.h
index 0c306cf279e..7f0d36f718b 100644
--- a/compiler-rt/include/sanitizer/hwasan_interface.h
+++ b/compiler-rt/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);