xref: /dflybsd-src/contrib/binutils-2.34/ld/ldver.c (revision b52ef7118d1621abed722c5bbbd542210290ecef)
1*fae548d3Szrj /* ldver.c -- Print linker version.
2*fae548d3Szrj    Copyright (C) 1991-2020 Free Software Foundation, Inc.
3*fae548d3Szrj 
4*fae548d3Szrj    This file is part of the GNU Binutils.
5*fae548d3Szrj 
6*fae548d3Szrj    This program is free software; you can redistribute it and/or modify
7*fae548d3Szrj    it under the terms of the GNU General Public License as published by
8*fae548d3Szrj    the Free Software Foundation; either version 3 of the License, or
9*fae548d3Szrj    (at your option) any later version.
10*fae548d3Szrj 
11*fae548d3Szrj    This program is distributed in the hope that it will be useful,
12*fae548d3Szrj    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*fae548d3Szrj    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*fae548d3Szrj    GNU General Public License for more details.
15*fae548d3Szrj 
16*fae548d3Szrj    You should have received a copy of the GNU General Public License
17*fae548d3Szrj    along with this program; if not, write to the Free Software
18*fae548d3Szrj    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19*fae548d3Szrj    MA 02110-1301, USA.  */
20*fae548d3Szrj 
21*fae548d3Szrj #include "sysdep.h"
22*fae548d3Szrj #include "bfd.h"
23*fae548d3Szrj #include "bfdver.h"
24*fae548d3Szrj #include "bfdlink.h"
25*fae548d3Szrj #include "ctf-api.h"
26*fae548d3Szrj #include "ld.h"
27*fae548d3Szrj #include "ldver.h"
28*fae548d3Szrj #include "ldexp.h"
29*fae548d3Szrj #include "ldlang.h"
30*fae548d3Szrj #include "ldfile.h"
31*fae548d3Szrj #include "ldemul.h"
32*fae548d3Szrj #include "ldmain.h"
33*fae548d3Szrj 
34*fae548d3Szrj void
ldversion(int noisy)35*fae548d3Szrj ldversion (int noisy)
36*fae548d3Szrj {
37*fae548d3Szrj   /* Output for noisy == 2 is intended to follow the GNU standards.  */
38*fae548d3Szrj   fprintf (stdout, _("GNU ld %s\n"), BFD_VERSION_STRING);
39*fae548d3Szrj 
40*fae548d3Szrj   if (noisy & 2)
41*fae548d3Szrj     {
42*fae548d3Szrj       printf (_("Copyright (C) 2020 Free Software Foundation, Inc.\n"));
43*fae548d3Szrj       printf (_("\
44*fae548d3Szrj This program is free software; you may redistribute it under the terms of\n\
45*fae548d3Szrj the GNU General Public License version 3 or (at your option) a later version.\n\
46*fae548d3Szrj This program has absolutely no warranty.\n"));
47*fae548d3Szrj     }
48*fae548d3Szrj 
49*fae548d3Szrj   if (noisy & 1)
50*fae548d3Szrj     {
51*fae548d3Szrj       ld_emulation_xfer_type **ptr = ld_emulations;
52*fae548d3Szrj 
53*fae548d3Szrj       printf (_("  Supported emulations:\n"));
54*fae548d3Szrj       while (*ptr)
55*fae548d3Szrj 	{
56*fae548d3Szrj 	  printf ("   %s\n", (*ptr)->emulation_name);
57*fae548d3Szrj 	  ptr++;
58*fae548d3Szrj 	}
59*fae548d3Szrj     }
60*fae548d3Szrj }
61