about summary refs log tree commit diff
path: root/gcc_plugin
diff options
context:
space:
mode:
Diffstat (limited to 'gcc_plugin')
-rw-r--r--gcc_plugin/Makefile3
-rw-r--r--gcc_plugin/afl-gcc-fast.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/gcc_plugin/Makefile b/gcc_plugin/Makefile
index 3da2e4f6..e81924e0 100644
--- a/gcc_plugin/Makefile
+++ b/gcc_plugin/Makefile
@@ -68,8 +68,7 @@ LDFLAGS_ADD=$(_LDFLAGS_ADD:0=-lrt)
 CFLAGS += $(CFLAGS_ADD)
 LDFLAGS += $(LDFLAGS_ADD)
 
-PROGS        = ../afl-gcc-fast ../afl-gcc-pass.so ../afl-gcc-rt.o
-
+PROGS        = ../afl-gcc-pass.so ../afl-gcc-fast ../afl-gcc-rt.o
 
 all: test_shm test_deps $(PROGS) afl-gcc-fast.8 test_build all_done
 
diff --git a/gcc_plugin/afl-gcc-fast.c b/gcc_plugin/afl-gcc-fast.c
index 0e51ee62..164c72c2 100644
--- a/gcc_plugin/afl-gcc-fast.c
+++ b/gcc_plugin/afl-gcc-fast.c
@@ -123,11 +123,17 @@ static void edit_params(u32 argc, char **argv) {
     u8 *alt_cxx = getenv("AFL_CXX");
     cc_params[0] = alt_cxx && *alt_cxx ? alt_cxx : (u8 *)AFL_GCC_CXX;
 
-  } else {
+  } else if (!strcmp(name, "afl-gcc-fast")) {
 
     u8 *alt_cc = getenv("AFL_CC");
     cc_params[0] = alt_cc && *alt_cc ? alt_cc : (u8 *)AFL_GCC_CC;
 
+  } else {
+
+    fprintf(stderr, "Name of the binary: %s\n", argv[0]);
+    FATAL(
+        "Name of the binary is not a known name, expected afl-(gcc|g++)-fast");
+
   }
 
   char *fplugin_arg = alloc_printf("-fplugin=%s/afl-gcc-pass.so", obj_path);