gold -v should continue and do the link just like GNU ld.
Sriraman Tallam
tmsriram@google.com
Mon Dec 21 23:39:00 GMT 2009
Hi,
GNU ld does go ahead and link after -v and does not stop after
printing the version. Here is a patch to make gold do the same.
* options.cc (General_options::parse_version): Make -v continue and do
the link like GNU ld does.
Index: options.cc
===================================================================
RCS file: /cvs/src/src/gold/options.cc,v
retrieving revision 1.94
diff -u -u -p -r1.94 options.cc
--- options.cc 14 Oct 2009 05:25:01 -0000 1.94
+++ options.cc 21 Dec 2009 23:27:26 -0000
@@ -288,8 +288,10 @@ General_options::parse_help(const char*,
void
General_options::parse_version(const char* opt, const char*, Command_line*)
{
- gold::print_version(opt[0] == '-' && opt[1] == 'v');
- ::exit(EXIT_SUCCESS);
+ bool print_short = (opt[0] == '-' && opt[1] == 'v');
+ gold::print_version(print_short);
+ if (!print_short)
+ ::exit(EXIT_SUCCESS);
}
Note that, --version should just stop after printing the message.
Is this ok to commit ?
Thanks,
-Sriraman.
More information about the Binutils
mailing list