aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2024-04-19 17:34:50 +0200
committervanhauser-thc <vh@thc.org>2024-04-19 17:34:50 +0200
commit458b939bc4f0ed4016c2741529435a72283ffc74 (patch)
treebf1e50f721edcb9c099ac2041974ec1ade769a57
parent476aca5b67f2926f0cdc7c50e9669e68cad9a851 (diff)
downloadafl++-458b939bc4f0ed4016c2741529435a72283ffc74.tar.gz
LTO fix
-rw-r--r--docs/Changelog.md3
-rw-r--r--instrumentation/SanitizerCoverageLTO.so.cc2
-rw-r--r--src/afl-cc.c5
3 files changed, 3 insertions, 7 deletions
diff --git a/docs/Changelog.md b/docs/Changelog.md
index a7eb239b..4e34baea 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -4,7 +4,8 @@
release of the tool. See README.md for the general instruction manual.
### Version ++4.21a (dev)
- * your PR? :-)
+ * afl-cc:
+ - fixes for LTO and outdated afl-gcc mode
### Version ++4.20c (release)
diff --git a/instrumentation/SanitizerCoverageLTO.so.cc b/instrumentation/SanitizerCoverageLTO.so.cc
index 4518c1c7..14482deb 100644
--- a/instrumentation/SanitizerCoverageLTO.so.cc
+++ b/instrumentation/SanitizerCoverageLTO.so.cc
@@ -341,7 +341,7 @@ llvmGetPassPluginInfo() {
using OptimizationLevel = typename PassBuilder::OptimizationLevel;
#endif
#if LLVM_VERSION_MAJOR >= 15
- PB.registerFullLinkTimeOptimizationEarlyEPCallback(
+ PB.registerFullLinkTimeOptimizationLastEPCallback(
#else
PB.registerOptimizerLastEPCallback(
#endif
diff --git a/src/afl-cc.c b/src/afl-cc.c
index 202e8145..15a5bd8e 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -1269,13 +1269,8 @@ void mode_final_checkout(aflcc_state_t *aflcc, int argc, char **argv) {
aflcc->instrument_mode == INSTRUMENT_PCGUARD) {
aflcc->lto_mode = 1;
- // force CFG
- // if (!aflcc->instrument_mode) {
-
aflcc->instrument_mode = INSTRUMENT_PCGUARD;
- // }
-
} else if (aflcc->instrument_mode == INSTRUMENT_CLASSIC) {
aflcc->lto_mode = 1;