1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

elf: Implement ld.so --version

This prints out version information for the dynamic loader and
exits immediately, without further command line processing
(which seems to match what some GNU tools do).

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Florian Weimer
2020-10-08 15:33:00 +02:00
parent addff78f1f
commit 542923d949
3 changed files with 20 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include <dl-main.h>
#include <ldsodefs.h>
#include <unistd.h>
#include "version.h"
void
_dl_usage (const char *argv0, const char *wrong_option)
@ -32,6 +33,19 @@ _dl_usage (const char *argv0, const char *wrong_option)
_exit (EXIT_FAILURE);
}
void
_dl_version (void)
{
_dl_printf ("\
ld.so " PKGVERSION RELEASE " release version " VERSION ".\n\
Copyright (C) 2020 Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions.\n\
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
PARTICULAR PURPOSE.\n\
");
_exit (EXIT_SUCCESS);
}
void
_dl_help (const char *argv0, struct dl_main_state *state)
{
@ -61,6 +75,7 @@ of this helper program; chances are you did not intend to run this program.\n\
--preload LIST preload objects named in LIST\n\
--argv0 STRING set argv[0] to STRING before running\n\
--help display this help and exit\n\
--version output version information and exit\n\
",
argv0);
_exit (EXIT_SUCCESS);