aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-03-25 23:30:48 +0000
committerIan Lance Taylor <ian@airs.com>2008-03-25 23:30:48 +0000
commitf4b2c6f5d1dad40d0fbe85cb1b20ad8cf4a8797c (patch)
treec0af11b8d0779722012f16332b85be5664529b8e
parentb896398099b53622a920ac9b2bb1926aa9d01bda (diff)
downloadgdb-f4b2c6f5d1dad40d0fbe85cb1b20ad8cf4a8797c.zip
gdb-f4b2c6f5d1dad40d0fbe85cb1b20ad8cf4a8797c.tar.gz
gdb-f4b2c6f5d1dad40d0fbe85cb1b20ad8cf4a8797c.tar.bz2
* version.cc (print_version): Adjust output for current value of
BFD_VERSION_STRING.
-rw-r--r--gold/ChangeLog5
-rw-r--r--gold/version.cc18
2 files changed, 20 insertions, 3 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 74d4eb2..fc6032e 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,5 +1,10 @@
2008-03-25 Ian Lance Taylor <iant@google.com>
+ * version.cc (print_version): Adjust output for current value of
+ BFD_VERSION_STRING.
+
+ * NEWS: New file.
+
* options.cc (options::help): Print list of supported targets.
* target-select.h: Include <vector>.
(class Target_selector): Make machine_, size_, and is_big_endian_
diff --git a/gold/version.cc b/gold/version.cc
index 489880d..9e3ec28 100644
--- a/gold/version.cc
+++ b/gold/version.cc
@@ -40,9 +40,21 @@ static const char* version_string = "1.4";
void
print_version(bool print_short)
{
- /* xgettext:c-format */
- printf("GNU gold (GNU binutils %s) version %s\n",
- BFD_VERSION_STRING, version_string);
+ // The --version output is intended to follow the GNU coding
+ // standards. We want to print something like:
+ // GNU gold (GNU binutils 2.19) 1.4
+ // BFD_VERSION_STRING looks like "(GNU Binutils) 2.19". We take off
+ // those parentheses.
+ std::string bfd_version(BFD_VERSION_STRING);
+ if (bfd_version[0] == '(')
+ {
+ bfd_version.erase(0, 1);
+ size_t pos = bfd_version.find(')');
+ if (pos != std::string::npos)
+ bfd_version.erase(pos, 1);
+ }
+
+ printf("GNU gold (%s) %s\n", bfd_version.c_str(), version_string);
if (!print_short)
{