X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gold%2Fversion.cc;h=dd32f4e2bc79867cd7e4c9980ace85e7a696f3f1;hb=a58b0053f4c4b4f0089f3985a41d0deac4c59ea4;hp=2e6a136b1351286d444057e578ca01b62ae7e24a;hpb=53765ea3d793c1f2114aa4441e561fb81406c201;p=binutils-gdb.git diff --git a/gold/version.cc b/gold/version.cc index 2e6a136b135..dd32f4e2bc7 100644 --- a/gold/version.cc +++ b/gold/version.cc @@ -1,6 +1,6 @@ // version.c -- print gold version information -// Copyright 2006, 2007 Free Software Foundation, Inc. +// Copyright (C) 2006-2022 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -22,6 +22,9 @@ #include "gold.h" +#include +#include + #include "../bfd/bfdver.h" namespace gold @@ -33,22 +36,34 @@ namespace gold // version number from configure.ac. But it's easier to just change // this file for now. -static const char* version_string = "0.9"; +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) 2022 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"));