From d1d5e7c02a4b17f42b6334f258899d6543c9142c Mon Sep 17 00:00:00 2001 From: van Hauser Date: Wed, 15 Jan 2020 10:10:25 +0100 Subject: blacklist function support for llvm_mode --- llvm_mode/LLVMInsTrim.so.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'llvm_mode/LLVMInsTrim.so.cc') diff --git a/llvm_mode/LLVMInsTrim.so.cc b/llvm_mode/LLVMInsTrim.so.cc index 552cf580..11451b43 100644 --- a/llvm_mode/LLVMInsTrim.so.cc +++ b/llvm_mode/LLVMInsTrim.so.cc @@ -94,6 +94,28 @@ struct InsTrim : public ModulePass { } + // ripped from aflgo + static bool isBlacklisted(const Function *F) { + + static const SmallVector Blacklist = { + + "asan.", + "llvm.", + "sancov.", + "__ubsan_handle_", + + }; + + for (auto const &BlacklistFunc : Blacklist) { + + if (F->getName().startswith(BlacklistFunc)) { return true; } + + } + + return false; + + } + bool runOnModule(Module &M) override { char be_quiet = 0; @@ -240,6 +262,8 @@ struct InsTrim : public ModulePass { } + if (isBlacklisted(&F)) continue; + std::unordered_set MS; if (!MarkSetOpt) { -- cgit 1.4.1