diff mbox series

[13/30] elf: Print the full name of the dynamic loader in the ld.so help message

Message ID 01dfe71f8b07be2d2c0e6006eef0e320deea3c77.1592836143.git.fweimer@redhat.com
State New
Headers show
Series RFC: elf: glibc-hwcaps support | expand

Commit Message

Florian Weimer June 22, 2020, 3:14 p.m. UTC
This requires defining a macro for the full path, matching the
-Wl,--dynamic-link= arguments used for linking glibc programs,
and ldd script.
---
 elf/Makefile   | 3 ++-
 elf/dl-usage.c | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/elf/Makefile b/elf/Makefile
index 85f7e08e00..d2f58c8ce6 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -648,7 +648,8 @@  libof-ldconfig = ldconfig
 CFLAGS-dl-cache.c += $(SYSCONF-FLAGS)
 CFLAGS-cache.c += $(SYSCONF-FLAGS)
 CFLAGS-rtld.c += $(SYSCONF-FLAGS)
-CFLAGS-dl-usage.c += $(SYSCONF-FLAGS)
+CFLAGS-dl-usage.c += $(SYSCONF-FLAGS) \
+  -D'RTLD="$(rtlddir)/$(rtld-installed-name)"'
 
 cpp-srcs-left := $(all-rtld-routines:=.os)
 lib := rtld
diff --git a/elf/dl-usage.c b/elf/dl-usage.c
index 0a12c631a6..5caf9794c6 100644
--- a/elf/dl-usage.c
+++ b/elf/dl-usage.c
@@ -75,6 +75,8 @@  setting environment variables (which would be inherted by subprocesses).\n\
   --preload LIST        preload objects named in LIST\n\
   --help                display this help and exit\n\
   --version             output version information and exit\n\
+\n\
+This program interpreter self-identifies as: " RTLD "\n\
 ",
               argv0);
   _exit (0);