This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
gold -v should continue and do the link just like GNU ld.
- From: Sriraman Tallam <tmsriram at google dot com>
- To: binutils at sourceware dot org
- Cc: Ian Lance Taylor <iant at google dot com>
- Date: Mon, 21 Dec 2009 15:39:49 -0800
- Subject: gold -v should continue and do the link just like GNU ld.
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.