This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH COMMITTED: Add --noinhibit-exec to gold


This simple patch adds support for --noinhibit-exec to gold (if only
it had been called --no-inhibit-exec, to match the usual --no-FLAG
convention).

With this patch, all the libmudflap tests pass with gold.

Ian


2008-04-08  Ian Lance Taylor  <iant@google.com>

	* options.h (class General_options): Add --noinhibit-exec option.
	* main.cc (main): Check --noinhibit-exec.


Index: main.cc
===================================================================
RCS file: /cvs/src/src/gold/main.cc,v
retrieving revision 1.22
diff -p -u -r1.22 main.cc
--- main.cc	26 Mar 2008 23:36:46 -0000	1.22
+++ main.cc	9 Apr 2008 01:15:16 -0000
@@ -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: options.h
===================================================================
RCS file: /cvs/src/src/gold/options.h,v
retrieving revision 1.67
diff -p -u -r1.67 options.h
--- options.h	9 Apr 2008 00:48:13 -0000	1.67
+++ options.h	9 Apr 2008 01:15:16 -0000
@@ -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"));
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]