* options.h (class General_options): Add --noinhibit-exec option.
authorIan Lance Taylor <ian@airs.com>
Wed, 9 Apr 2008 01:19:09 +0000 (01:19 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 9 Apr 2008 01:19:09 +0000 (01:19 +0000)
* main.cc (main): Check --noinhibit-exec.

gold/ChangeLog
gold/main.cc
gold/options.h

index 73347b19d311e93f0ecb7d74b55517be7f631f72..e79fd7b81bc2b556a7326b9a944d00f06887977a 100644 (file)
@@ -1,5 +1,8 @@
 2008-04-08  Ian Lance Taylor  <iant@google.com>
 
+       * options.h (class General_options): Add --noinhibit-exec option.
+       * main.cc (main): Check --noinhibit-exec.
+
        * options.h (class General_options): Define --wrap as a special
        option.  Add wrap_symbols_ field.
        (General_options::any_wrap_symbols): New function.
index 2966d0351edf619a80ce3e4032b747dbab36948e..9b6ded0810b39594fd825e45d17c133106359151 100644 (file)
@@ -220,5 +220,8 @@ main(int argc, char** argv)
       layout.print_stats();
     }
 
-  gold_exit(errors.error_count() == 0);
+  // If the user used --noinhibit-exec, we force the exit status to be
+  // successful.  This is compatible with GNU ld.
+  gold_exit(errors.error_count() == 0
+           || parameters->options().noinhibit_exec());
 }
index 487603fa87fe167085611246d72127b6e0efef7b..8d624e5b0057153c3c151fecca4cbe77e480329c 100644 (file)
@@ -538,6 +538,9 @@ class General_options
   DEFINE_string(m, options::EXACTLY_ONE_DASH, 'm', "",
                 N_("Ignored for compatibility"), N_("EMULATION"));
 
+  DEFINE_bool(noinhibit_exec, options::TWO_DASHES, '\0', false,
+             N_("Create an output file even if errors occur"), NULL);
+
   DEFINE_string(output, options::TWO_DASHES, 'o', "a.out",
                 N_("Set output file name"), N_("FILE"));