]> granicus.if.org Git - llvm/commitdiff
[libFuzzer] Do not use llvm-objdump for disassembling a DSO.
authorMarcos Pividori <mpividori@google.com>
Wed, 1 Feb 2017 17:59:23 +0000 (17:59 +0000)
committerMarcos Pividori <mpividori@google.com>
Wed, 1 Feb 2017 17:59:23 +0000 (17:59 +0000)
When disassembling a DSO, for calls to functions from the PLT, llvm-objdump only
prints the offset from the PLT, like: <.plt+0x30>.

While objdump and dumpbin print the function name, like:
<__sanitizer_cov_trace_pc_guard@plt>

When analyzing the coverage in libFuzzer we dissasemble and look for the calls
to __sanitizer_cov_trace_pc_guard.

So, this fails when using llvm-objdump on a DSO.

Differential Revision: https://reviews.llvm.org/D29372

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293791 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Fuzzer/FuzzerUtilWindows.cpp

index 34a17cf305bb3440c42ce8f5632c34bf46dc1750..7fd09e0ed1bc735b661811e4ab5aaf511627a9e0 100644 (file)
@@ -181,10 +181,7 @@ const void *SearchMemory(const void *Data, size_t DataLen, const void *Patt,
 std::string DisassembleCmd(const std::string &FileName) {
   if (ExecuteCommand("dumpbin /summary > nul") == 0)
     return "dumpbin /disasm " + FileName;
-  if (ExecuteCommand("llvm-objdump > nul") == 0)
-    return "llvm-objdump -d " + FileName;
-  Printf("libFuzzer: couldn't find tool to disassemble (dumpbin, "
-      "llvm-objdump)\n");
+  Printf("libFuzzer: couldn't find tool to disassemble (dumpbin)\n");
   exit(1);
 }