// version.c -- print gold version information
-// Copyright 2006, 2007, 200 Free Software Foundation, Inc.
+// Copyright (C) 2006-2019 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
#include "gold.h"
+#include <string>
+#include <cstdio>
+
#include "../bfd/bfdver.h"
namespace gold
// version number from configure.ac. But it's easier to just change
// this file for now.
-static const char* version_string = "1.4";
+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 2008 Free Software Foundation, Inc.\n"));
- printf (_("\
+ printf(_("Copyright (C) 2019 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"));