From 448c6c212de97bf655cab1fd2351bfcea3dcfe53 Mon Sep 17 00:00:00 2001 From: Kuang-che Wu Date: Mon, 21 Apr 2025 09:00:40 +0000 Subject: [PATCH] fix __AFL_COVERAGE: multiple definition of `__afl_selective_coverage` fix #2390 --- src/afl-cc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/afl-cc.c b/src/afl-cc.c index d91b9194..10b090a7 100644 --- a/src/afl-cc.c +++ b/src/afl-cc.c @@ -1534,7 +1534,7 @@ void add_defs_selective_instr(aflcc_state_t *aflcc) { if (aflcc->plusplus_mode) { insert_param(aflcc, - "-D__AFL_COVERAGE()=int __afl_selective_coverage = 1;" + "-D__AFL_COVERAGE()=int __afl_selective_coverage __attribute__ ((weak)) = 1;" "extern \"C\" void __afl_coverage_discard();" "extern \"C\" void __afl_coverage_skip();" "extern \"C\" void __afl_coverage_on();" @@ -1543,7 +1543,7 @@ void add_defs_selective_instr(aflcc_state_t *aflcc) { } else { insert_param(aflcc, - "-D__AFL_COVERAGE()=int __afl_selective_coverage = 1;" + "-D__AFL_COVERAGE()=int __afl_selective_coverage __attribute__ ((weak)) = 1;" "void __afl_coverage_discard();" "void __afl_coverage_skip();" "void __afl_coverage_on();"