PATCH: fix crashing bug in 'ld -L. --help'

Cary Coutant ccoutant@google.com
Fri Mar 6 18:52:00 GMT 2009


>>       * options.cc (help): Don't print pseudo-option '-z'.

Here's an alternative fix. This one keeps the pseudo-option from
registering itself in the global list of options, simply by setting
the helpstring to NULL.

-cary


   * options.cc (parse_short_option): Keep dash_z from registering itself.


Index: options.cc
===================================================================
RCS file: /cvs/src/src/gold/options.cc,v
retrieving revision 1.83
diff -u -p -r1.83 options.cc
--- options.cc	28 Feb 2009 04:39:57 -0000	1.83
+++ options.cc	6 Mar 2009 18:43:59 -0000
@@ -587,7 +587,7 @@ parse_short_option(int argc, const char*

   // We handle -z as a special case.
   static gold::options::One_option dash_z("", gold::options::DASH_Z,
-                                          'z', "", "-z", "Z-OPTION", false,
+                                          'z', "", NULL, "Z-OPTION", false,
 					  NULL);
   gold::options::One_option* retval = NULL;
   if (this_argv[pos_in_argv_i] == 'z')



More information about the Binutils mailing list