mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 20:08:07 +00:00
cmplog support for gcc_plugin by adacore
This commit is contained in:
25
src/afl-cc.c
25
src/afl-cc.c
@ -422,8 +422,24 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
||||
|
||||
if (compiler_mode == GCC_PLUGIN) {
|
||||
|
||||
char *fplugin_arg = alloc_printf("-fplugin=%s/afl-gcc-pass.so", obj_path);
|
||||
cc_params[cc_par_cnt++] = fplugin_arg;
|
||||
char *fplugin_arg;
|
||||
|
||||
if (cmplog_mode)
|
||||
{
|
||||
fplugin_arg = alloc_printf("-fplugin=%s/afl-gcc-cmplog-pass.so",
|
||||
obj_path);
|
||||
cc_params[cc_par_cnt++] = fplugin_arg;
|
||||
fplugin_arg = alloc_printf("-fplugin=%s/afl-gcc-cmptrs-pass.so",
|
||||
obj_path);
|
||||
cc_params[cc_par_cnt++] = fplugin_arg;
|
||||
}
|
||||
else
|
||||
{
|
||||
fplugin_arg = alloc_printf("-fplugin=%s/afl-gcc-pass.so",
|
||||
obj_path);
|
||||
cc_params[cc_par_cnt++] = fplugin_arg;
|
||||
}
|
||||
|
||||
cc_params[cc_par_cnt++] = "-fno-if-conversion";
|
||||
cc_params[cc_par_cnt++] = "-fno-if-conversion2";
|
||||
|
||||
@ -1879,6 +1895,7 @@ int main(int argc, char **argv, char **envp) {
|
||||
if (have_gcc_plugin)
|
||||
SAYF(
|
||||
"\nGCC Plugin-specific environment variables:\n"
|
||||
" AFL_GCC_CMPLOG: log operands of comparisons (RedQueen mutator)\n"
|
||||
" AFL_GCC_OUT_OF_LINE: disable inlined instrumentation\n"
|
||||
" AFL_GCC_SKIP_NEVERZERO: do not skip zero on trace counters\n"
|
||||
" AFL_GCC_INSTRUMENT_FILE: enable selective instrumentation by "
|
||||
@ -2149,9 +2166,7 @@ int main(int argc, char **argv, char **envp) {
|
||||
|
||||
}
|
||||
|
||||
cmplog_mode = getenv("AFL_CMPLOG") || getenv("AFL_LLVM_CMPLOG");
|
||||
if (!be_quiet && cmplog_mode)
|
||||
printf("CmpLog mode by <andreafioraldi@gmail.com>\n");
|
||||
cmplog_mode = getenv("AFL_CMPLOG") || getenv("AFL_LLVM_CMPLOG") || getenv("AFL_GCC_CMPLOG");
|
||||
|
||||
#if !defined(__ANDROID__) && !defined(ANDROID)
|
||||
ptr = find_object("afl-compiler-rt.o", argv[0]);
|
||||
|
Reference in New Issue
Block a user