175fd0b74Schristos /* ldver.c -- Print linker version.
2*e992f068Schristos Copyright (C) 1991-2022 Free Software Foundation, Inc.
375fd0b74Schristos
475fd0b74Schristos This file is part of the GNU Binutils.
575fd0b74Schristos
675fd0b74Schristos This program is free software; you can redistribute it and/or modify
775fd0b74Schristos it under the terms of the GNU General Public License as published by
875fd0b74Schristos the Free Software Foundation; either version 3 of the License, or
975fd0b74Schristos (at your option) any later version.
1075fd0b74Schristos
1175fd0b74Schristos This program is distributed in the hope that it will be useful,
1275fd0b74Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of
1375fd0b74Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1475fd0b74Schristos GNU General Public License for more details.
1575fd0b74Schristos
1675fd0b74Schristos You should have received a copy of the GNU General Public License
1775fd0b74Schristos along with this program; if not, write to the Free Software
1875fd0b74Schristos Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
1975fd0b74Schristos MA 02110-1301, USA. */
2075fd0b74Schristos
2175fd0b74Schristos #include "sysdep.h"
2275fd0b74Schristos #include "bfd.h"
2375fd0b74Schristos #include "bfdver.h"
24012573ebSchristos #include "bfdlink.h"
25012573ebSchristos #include "ctf-api.h"
2675fd0b74Schristos #include "ld.h"
2775fd0b74Schristos #include "ldver.h"
2875fd0b74Schristos #include "ldexp.h"
2975fd0b74Schristos #include "ldlang.h"
3075fd0b74Schristos #include "ldfile.h"
3175fd0b74Schristos #include "ldemul.h"
3275fd0b74Schristos #include "ldmain.h"
3375fd0b74Schristos
3475fd0b74Schristos void
ldversion(int noisy)3575fd0b74Schristos ldversion (int noisy)
3675fd0b74Schristos {
3775fd0b74Schristos /* Output for noisy == 2 is intended to follow the GNU standards. */
3875fd0b74Schristos fprintf (stdout, _("GNU ld %s\n"), BFD_VERSION_STRING);
3975fd0b74Schristos
4075fd0b74Schristos if (noisy & 2)
4175fd0b74Schristos {
42*e992f068Schristos printf (_("Copyright (C) 2022 Free Software Foundation, Inc.\n"));
4375fd0b74Schristos printf (_("\
4475fd0b74Schristos This program is free software; you may redistribute it under the terms of\n\
4575fd0b74Schristos the GNU General Public License version 3 or (at your option) a later version.\n\
4675fd0b74Schristos This program has absolutely no warranty.\n"));
4775fd0b74Schristos }
4875fd0b74Schristos
4975fd0b74Schristos if (noisy & 1)
5075fd0b74Schristos {
5175fd0b74Schristos ld_emulation_xfer_type **ptr = ld_emulations;
5275fd0b74Schristos
5375fd0b74Schristos printf (_(" Supported emulations:\n"));
5475fd0b74Schristos while (*ptr)
5575fd0b74Schristos {
5675fd0b74Schristos printf (" %s\n", (*ptr)->emulation_name);
5775fd0b74Schristos ptr++;
5875fd0b74Schristos }
5975fd0b74Schristos }
6075fd0b74Schristos }
61