ldver.c 1.8 KB

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