[all-commits] [llvm/llvm-project] f78d9f: [libFuzzer] Link libFuzzer's own interceptors when...

Dokyung Song via All-commits all-commits at lists.llvm.org
Thu Jul 16 13:27:00 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f78d9fceea736d431e9e3cbca291e3909e3aa46d
      https://github.com/llvm/llvm-project/commit/f78d9fceea736d431e9e3cbca291e3909e3aa46d
  Author: Dokyung Song <dokyungs at google.com>
  Date:   2020-07-16 (Thu, 16 Jul 2020)

  Changed paths:
    M clang/include/clang/Driver/SanitizerArgs.h
    M clang/lib/Driver/SanitizerArgs.cpp
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M compiler-rt/lib/fuzzer/CMakeLists.txt
    A compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp
    M compiler-rt/test/fuzzer/memcmp.test
    M compiler-rt/test/fuzzer/memcmp64.test
    M compiler-rt/test/fuzzer/strcmp.test
    M compiler-rt/test/fuzzer/strncmp.test
    M compiler-rt/test/fuzzer/strstr.test

  Log Message:
  -----------
  [libFuzzer] Link libFuzzer's own interceptors when other compiler runtimes are not linked.

Summary: libFuzzer intercepts certain library functions such as memcmp/strcmp by defining weak hooks. Weak hooks, however, are called only when other runtimes such as ASan is linked. This patch defines libFuzzer's own interceptors, which is linked into the libFuzzer executable when other runtimes are not linked, i.e., when -fsanitize=fuzzer is given, but not others.

Reviewers: kcc, morehouse, hctim

Reviewed By: morehouse, hctim

Subscribers: krytarowski, mgorny, cfe-commits, #sanitizers

Tags: #clang, #sanitizers

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




More information about the All-commits mailing list