e354a5
commit db03874df9843ab98c4faeb658f04d17e6db83a6
e354a5
Author: Florian Weimer <fweimer@redhat.com>
e354a5
Date:   Thu Oct 8 15:33:00 2020 +0200
e354a5
e354a5
    elf: Print the full name of the dynamic loader in the ld.so help message
e354a5
    
e354a5
    This requires defining a macro for the full path, matching the
e354a5
    -Wl,--dynamic-link= arguments used for linking glibc programs,
e354a5
    and ldd script.
e354a5
    
e354a5
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
e354a5
e354a5
diff --git a/elf/Makefile b/elf/Makefile
e354a5
index e5666e5bf7817c3c..bc96b8fd65e376cc 100644
e354a5
--- a/elf/Makefile
e354a5
+++ b/elf/Makefile
e354a5
@@ -641,7 +641,8 @@ libof-ldconfig = ldconfig
e354a5
 CFLAGS-dl-cache.c += $(SYSCONF-FLAGS)
e354a5
 CFLAGS-cache.c += $(SYSCONF-FLAGS)
e354a5
 CFLAGS-rtld.c += $(SYSCONF-FLAGS)
e354a5
-CFLAGS-dl-usage.c += $(SYSCONF-FLAGS)
e354a5
+CFLAGS-dl-usage.c += $(SYSCONF-FLAGS) \
e354a5
+  -D'RTLD="$(rtlddir)/$(rtld-installed-name)"'
e354a5
 
e354a5
 cpp-srcs-left := $(all-rtld-routines:=.os)
e354a5
 lib := rtld
e354a5
diff --git a/elf/dl-usage.c b/elf/dl-usage.c
e354a5
index 8c24c13770500df9..1003a435bfc2b39e 100644
e354a5
--- a/elf/dl-usage.c
e354a5
+++ b/elf/dl-usage.c
e354a5
@@ -76,6 +76,8 @@ setting environment variables (which would be inherited by subprocesses).\n\
e354a5
   --argv0 STRING        set argv[0] to STRING before running\n\
e354a5
   --help                display this help and exit\n\
e354a5
   --version             output version information and exit\n\
e354a5
+\n\
e354a5
+This program interpreter self-identifies as: " RTLD "\n\
e354a5
 ",
e354a5
               argv0);
e354a5
   _exit (EXIT_SUCCESS);