document workaround for targets with _init for LTO
@@ -16,6 +16,11 @@ This version requires a current llvm 11 compiled from the github master.
4. AUTODICTIONARY feature! see below
+5. If any problems arise be sure to set `AR=llvm-ar RANLIB=llvm-ranlib` also
+ note that if that target uses _init functions or early constructors then
+ also set `AFL_LLVM_MAP_DYNAMIC=1` as your target will crash otherwise
+
+
## Introduction and problem description
A big issue with how afl/afl++ works is that the basic block IDs that are
@@ -143,6 +148,13 @@ and LTO enabled (`CC=clang-11` `CXX=clang++-11` `CFLAGS=-flto=full` and
If this succeeeds then there is an issue with afl-clang-lto. Please report at
[https://github.com/AFLplusplus/AFLplusplus/issues/226](https://github.com/AFLplusplus/AFLplusplus/issues/226)
+### Target crashes immediately
+
+If the target is using early constructors (values smaller than 6) or have their
+own _init/.init functions and these are instrumented then the target will
+likely crash when started. This can be avoided by compiling with
+`AFL_LLVM_MAP_DYNAMIC=1` .
+
## Upcoming Work
1. Currently the LTO whitelist feature does not allow to instrument main,
