summaryrefslogtreecommitdiffstats
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
commitc68be8d2d523c8b3f5852fbb9ff553530e4e6bfd (patch)
tree09e0543f3744c7f4c8d8cbe9f799d04d7ba4802d /compiler-rt/include
parentcce7c24af13376e460a217a2bad01568de8fd6fb (diff)
downloadbcm5719-llvm-c68be8d2d523c8b3f5852fbb9ff553530e4e6bfd.tar.gz
bcm5719-llvm-c68be8d2d523c8b3f5852fbb9ff553530e4e6bfd.zip
[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 llvm-svn: 339606
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);
OpenPOWER on IntegriCloud