From 65f41a13dbdb7ebe9ef2c0d68f39e65a4534876b Mon Sep 17 00:00:00 2001 From: Packit Service Date: Mar 14 2021 14:58:24 +0000 Subject: Apply patch glibc-rh1817513-94.patch patch_name: glibc-rh1817513-94.patch present_in_specfile: true location_in_specfile: 495 --- diff --git a/elf/dl-main.h b/elf/dl-main.h index ac7249a..b51256d 100644 --- a/elf/dl-main.h +++ b/elf/dl-main.h @@ -105,6 +105,9 @@ call_init_paths (const struct dl_main_state *state) _Noreturn void _dl_usage (const char *argv0, const char *wrong_option) attribute_hidden; +/* Print ld.so version information and exit. */ +_Noreturn void _dl_version (void) attribute_hidden; + /* Print ld.so --help output and exit. */ _Noreturn void _dl_help (const char *argv0, struct dl_main_state *state) attribute_hidden; diff --git a/elf/dl-usage.c b/elf/dl-usage.c index c1820dc..f3c5ac7 100644 --- a/elf/dl-usage.c +++ b/elf/dl-usage.c @@ -20,6 +20,7 @@ #include #include #include +#include "version.h" void _dl_usage (const char *argv0, const char *wrong_option) @@ -33,6 +34,19 @@ _dl_usage (const char *argv0, const char *wrong_option) } 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) { _dl_printf ("\ @@ -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); diff --git a/elf/rtld.c b/elf/rtld.c index b92641c..da1eef1 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -1248,6 +1248,8 @@ dl_main (const ElfW(Phdr) *phdr, --_dl_argc; ++_dl_argv; } + else if (strcmp (_dl_argv[1], "--version") == 0) + _dl_version (); else if (_dl_argv[1][0] == '-' && _dl_argv[1][1] == '-') { if (_dl_argv[1][1] == '\0')