diff options
| author | Dan Liew <dan@su-root.co.uk> | 2016-06-06 20:27:09 +0000 |
|---|---|---|
| committer | Dan Liew <dan@su-root.co.uk> | 2016-06-06 20:27:09 +0000 |
| commit | 59144071852180e2b38eee34f9b2ed0d92e1716d (patch) | |
| tree | 9daac4e39198dae1e4e7fd014bede58b4e322963 /llvm/lib/Fuzzer | |
| parent | 47033ca521cd7c8a6d047396ecdeacb27486d41d (diff) | |
| download | bcm5719-llvm-59144071852180e2b38eee34f9b2ed0d92e1716d.tar.gz bcm5719-llvm-59144071852180e2b38eee34f9b2ed0d92e1716d.zip | |
[LibFuzzer] Provide stub implementation of __sanitizer_cov_trace_pc_indir
Calls to this function are currently injected by the
``SanitizerCoverageModule`` pass when the both the ``indirect-calls``
and ``trace-pc`` sanitizer coverage options are enabled and the code
being instrumented has indirect calls. Previously because LibFuzzer did
not define this function this would lead to link errors when building
some of the tests on OSX.
Differential Revision: http://reviews.llvm.org/D20946
llvm-svn: 271938
Diffstat (limited to 'llvm/lib/Fuzzer')
| -rw-r--r-- | llvm/lib/Fuzzer/FuzzerTracePC.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerTracePC.cpp b/llvm/lib/Fuzzer/FuzzerTracePC.cpp index 250deeff25f..46c43d0c17f 100644 --- a/llvm/lib/Fuzzer/FuzzerTracePC.cpp +++ b/llvm/lib/Fuzzer/FuzzerTracePC.cpp @@ -57,7 +57,15 @@ static void HandlePC(uint32_t PC) { } // namespace fuzzer -extern "C" void __sanitizer_cov_trace_pc() { +extern "C" { +void __sanitizer_cov_trace_pc() { fuzzer::HandlePC(static_cast<uint32_t>( reinterpret_cast<uintptr_t>(__builtin_return_address(0)))); } + +void __sanitizer_cov_trace_pc_indir(int *) { + // Stub to allow linking with code built with + // -fsanitize=indirect-calls,trace-pc. + // This isn't used currently. +} +} |

