[msan] Fast path optimization for wrap-indirect-calls feature of MemorySanitizer.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Thu, 14 Nov 2013 12:29:04 +0000 (12:29 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Thu, 14 Nov 2013 12:29:04 +0000 (12:29 +0000)
commit34432aeb6d42fbe3e327d1d339ea4156c99aa133
treea5e6cd9600a84a4a95ccf068c6688f58794ef089
parent05c837ec24ba0de81c2d4068b925996f3cadef53
[msan] Fast path optimization for wrap-indirect-calls feature of MemorySanitizer.

Indirect call wrapping helps MSanDR (dynamic instrumentation companion tool
for MSan) to catch all cases where execution leaves a compiler-instrumented
module by allowing the tool to rewrite targets of indirect calls.

This change is an optimization that skips wrapping for calls when target is
inside the current module. This relies on the linker providing symbols at the
begin and end of the module code (or code + data, does not really matter).
Gold linker provides such symbols by default. GNU (BFD) linker needs a link
flag: -Wl,--defsym=__executable_start=0.

More info:
https://code.google.com/p/memory-sanitizer/wiki/MSanDR#Native_exec

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194697 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/MemorySanitizer.cpp
test/Instrumentation/MemorySanitizer/wrap_indirect_calls.ll