Skip to content

Instantly share code, notes, and snippets.

@filcab
Created January 3, 2015 22:07
Show Gist options
  • Save filcab/e930ba4778483b0e23af to your computer and use it in GitHub Desktop.
Save filcab/e930ba4778483b0e23af to your computer and use it in GitHub Desktop.
afl-1.06b patch for no dead strip
diff -ru afl-1.06b/afl-gcc.c afl-1.06b-patched/afl-gcc.c
--- afl-1.06b/afl-gcc.c 2014-12-06 03:18:16.000000000 +0000
+++ afl-1.06b-patched/afl-gcc.c 2015-01-03 22:03:14.000000000 +0000
@@ -192,6 +192,11 @@
if (!strcmp(cur, "-pipe")) continue;
+ // Don't dead-strip for now since it might screw up some of our
+ // payloads, especially when subsections_via_symbols is emitted by the
+ // compiler (like clang does on MacOS X)
+ if (!strcmp(cur, "-Wl,-dead_strip")) continue;
+
#if defined(__FreeBSD__) && defined(__x86_64__)
if (!strcmp(cur, "-m32")) m32_set = 1;
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment