[llvm] r271938 - [LibFuzzer] Provide stub implementation of __sanitizer_cov_trace_pc_indir
Dan Liew via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 6 13:27:09 PDT 2016
Author: delcypher
Date: Mon Jun 6 15:27:09 2016
New Revision: 271938
URL: http://llvm.org/viewvc/llvm-project?rev=271938&view=rev
Log:
[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
Modified:
llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp
Modified: llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp?rev=271938&r1=271937&r2=271938&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp Mon Jun 6 15:27:09 2016
@@ -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.
+}
+}
More information about the llvm-commits
mailing list