fix for sancov
MODIFY
llvm_mode/afl-llvm-common.cc
llvm_mode/afl-llvm-common.cc
@@ -387,7 +387,8 @@ bool isInInstrumentList(llvm::Function *F) {
bool return_default = true;
// is this a function with code? If it is external we don't instrument it
- // anyway and it can't be in the instrument file list. Or if it is it is ignored.
+ // anyway and it can't be in the instrument file list. Or if it is it is
+ // ignored.
if (!F->size() || isIgnoreFunction(F)) return false;
if (!denyListFiles.empty() || !denyListFunctions.empty()) {

MODIFY
llvm_mode/afl-llvm-rt.o.c
llvm_mode/afl-llvm-rt.o.c
#endif
#endif
+#define CTOR_PRIO 3
+
#include <sys/mman.h>
#include <fcntl.h>
@@ -881,7 +883,7 @@ __attribute__((constructor())) void __afl_auto_init(void) {
/* Initialization of the shmem - earliest possible because of LTO fixed mem. */
-__attribute__((constructor(0))) void __afl_auto_early(void) {
+__attribute__((constructor(CTOR_PRIO))) void __afl_auto_early(void) {
if (getenv("AFL_DISABLE_LLVM_INSTRUMENTATION")) return;

fix for sancov