about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-08-14 06:46:22 +0200
committervan Hauser <vh@thc.org>2020-08-14 06:46:22 +0200
commit32fe047894cc241eb9c1b53e4b2b791ca9b145d1 (patch)
treec368ed333849ae56677a321975aa0a4875a72fe2
parentd1bc0207cc6e579fe914dcbb0b70653783b64598 (diff)
downloadafl++-32fe047894cc241eb9c1b53e4b2b791ca9b145d1.tar.gz
fix AFL_LLVM_MAP_DYNAMIC
-rw-r--r--llvm_mode/afl-clang-fast.c1
-rw-r--r--llvm_mode/afl-llvm-lto-instrumentation.so.cc2
2 files changed, 2 insertions, 1 deletions
diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c
index 0597ba17..e311a65e 100644
--- a/llvm_mode/afl-clang-fast.c
+++ b/llvm_mode/afl-clang-fast.c
@@ -1011,6 +1011,7 @@ int main(int argc, char **argv, char **envp) {
 #ifdef AFL_CLANG_FLTO
     SAYF(
         "\nafl-clang-lto specific environment variables:\n"
+        "AFL_LLVM_MAP_ADDR: use a fixed coverage map address (speed), e.g. 0x10000\n"
         "AFL_LLVM_LTO_DONTWRITEID: don't write the highest ID used to a "
         "global var\n"
         "AFL_LLVM_LTO_STARTID: from which ID to start counting from for a "
diff --git a/llvm_mode/afl-llvm-lto-instrumentation.so.cc b/llvm_mode/afl-llvm-lto-instrumentation.so.cc
index 6bd232ab..13c4f775 100644
--- a/llvm_mode/afl-llvm-lto-instrumentation.so.cc
+++ b/llvm_mode/afl-llvm-lto-instrumentation.so.cc
@@ -150,7 +150,7 @@ bool AFLLTOPass::runOnModule(Module &M) {
 
       map_addr = 0;
 
-    } else if (map_addr == 0) {
+    } else if (getenv("AFL_LLVM_MAP_DYNAMIC")) {
 
       FATAL(
           "AFL_LLVM_MAP_ADDR and AFL_LLVM_MAP_DYNAMIC cannot be used together");