gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gold / version.cc
index d7ad19cc59c431d1267ca0d4963ee31fa5286dd4..494e2334f2a3bd6803c5ba1030b9a89447663c94 100644 (file)
@@ -1,6 +1,6 @@
 // version.c -- print gold version information
 
-// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2006-2020 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -22,6 +22,9 @@
 
 #include "gold.h"
 
+#include <string>
+#include <cstdio>
+
 #include "../bfd/bfdver.h"
 
 namespace gold
@@ -33,26 +36,46 @@ namespace gold
 // version number from configure.ac.  But it's easier to just change
 // this file for now.
 
-static const char* version_string = "0.1";
+static const char* version_string = "1.16";
 
 // Report version information.
 
 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)
     {
       // This output is intended to follow the GNU standards.
-      printf (_("Copyright 2007 Free Software Foundation, Inc.\n"));
-      printf (_("\
+      printf(_("Copyright (C) 2020 Free Software Foundation, Inc.\n"));
+      printf(_("\
 This program is free software; you may redistribute it under the terms of\n\
 the GNU General Public License version 3 or (at your option) a later version.\n\
 This program has absolutely no warranty.\n"));
     }
 }
 
+// Return the version string.
+
+const char*
+get_version_string()
+{
+  return version_string;
+}
+
 } // End namespace gold.
This page took 0.023468 seconds and 4 git commands to generate.