From 38df6eb3a9d572d13a0554f6d511723feb644be6 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Sat, 23 May 2020 17:00:02 +0200 Subject: LTO whitelist functionality rewritten, now anything can be skipped --- llvm_mode/afl-llvm-lto-instrim.so.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'llvm_mode/afl-llvm-lto-instrim.so.cc') diff --git a/llvm_mode/afl-llvm-lto-instrim.so.cc b/llvm_mode/afl-llvm-lto-instrim.so.cc index a7d9b756..27504e8d 100644 --- a/llvm_mode/afl-llvm-lto-instrim.so.cc +++ b/llvm_mode/afl-llvm-lto-instrim.so.cc @@ -561,6 +561,17 @@ struct InsTrimLTO : public ModulePass { if (F.size() < function_minimum_size) continue; if (isBlacklisted(&F)) continue; + // whitelist check + AttributeList Attrs = F.getAttributes(); + if (Attrs.hasAttribute(-1, StringRef("skipinstrument"))) { + + if (debug) + fprintf(stderr, "DEBUG: Function %s is not whitelisted\n", + F.getName().str().c_str()); + continue; + + } + std::unordered_set MS; if (!MarkSetOpt) { -- cgit 1.4.1