Don't include libhfuzz at the beginning
@@ -255,15 +255,6 @@ static int ldMode(int argc, char **argv)
args[j++] = "cc";
}
- /*
- * Include libhfuzz.a before everything else which might hijack
- * functions we need, i.e. *cmp and LLVMFuzzer*
- */
- args[j++] = "-Wl,-z,muldefs";
- args[j++] = "-Wl,--whole-archive";
- args[j++] = LHFUZZ_A_PATH;
- args[j++] = "-Wl,--no-whole-archive";
-
/* Intercept common *cmp functions */
args[j++] = "-Wl,--wrap=strcmp";
args[j++] = "-Wl,--wrap=strcasecmp";
@@ -293,7 +284,13 @@ static int ldMode(int argc, char **argv)
args[j++] = argv[i];
}
+ /*
+ * Include whole libhfuzz.a
+ */
+ args[j++] = "-Wl,-z,muldefs";
+ args[j++] = "-Wl,--whole-archive";
args[j++] = LHFUZZ_A_PATH;
+ args[j++] = "-Wl,--no-whole-archive";
return execCC(j, args);
}
