about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2020-08-05 10:27:48 +0200
committerAndrea Fioraldi <andreafioraldi@gmail.com>2020-08-05 10:27:48 +0200
commitbd36aac60a6d85fe83d072bf00a9ec0b2f3f135d (patch)
treead460746621d67cd9c66731425f058d65160dde4
parent8fc727e597f26161fde7f38af8b805a39497da52 (diff)
downloadafl++-bd36aac60a6d85fe83d072bf00a9ec0b2f3f135d.tar.gz
remove shared_linking case
-rw-r--r--llvm_mode/afl-clang-fast.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c
index 750a6fbd..16f2c9c0 100644
--- a/llvm_mode/afl-clang-fast.c
+++ b/llvm_mode/afl-clang-fast.c
@@ -162,7 +162,7 @@ static void find_obj(u8 *argv0) {
 static void edit_params(u32 argc, char **argv, char **envp) {
 
   u8  fortify_set = 0, asan_set = 0, x_set = 0, bit_mode = 0,
-      shared_linking = 0, preprocessor_only = 0;
+      preprocessor_only = 0;
   u8  have_pic = 0;
   u8 *name;
 
@@ -402,7 +402,6 @@ static void edit_params(u32 argc, char **argv, char **envp) {
     if (lto_mode && !strncmp(cur, "--ld-path=", 10)) continue;
     
     if (!strcmp(cur, "-E")) preprocessor_only = 1;
-    if (!strcmp(cur, "-shared")) shared_linking = 1;
 
     cc_params[cc_par_cnt++] = cur;
 
@@ -568,18 +567,12 @@ static void edit_params(u32 argc, char **argv, char **envp) {
 
   }
   
-  if (preprocessor_only || shared_linking) {
+  if (preprocessor_only) {
     /* In the preprocessor_only case (-E), we are not actually compiling at
        all but requesting the compiler to output preprocessed sources only.
        We must not add the runtime in this case because the compiler will
        simply output its binary content back on stdout, breaking any build
-       systems that rely on a separate source preprocessing step.
-       The shared_linking case (-shared) is more complex. This flag should
-       only be passed when linking a shared object. When loading such a shared
-       object into a binary that has also been built with AFL, two AFL runtimes
-       will exist side-by-side. This is only a problem in the dynamic loading
-       case because for static linking, the compiler can de-duplicate the
-       runtime. We must hence avoid attaching the runtime to shared objects. */
+       systems that rely on a separate source preprocessing step. */
     cc_params[cc_par_cnt] = NULL;
     return;
   }