6c0556
commit 2e75604f8337fa4332977f72a8f6726309679edf
6c0556
Author: Florian Weimer <fweimer@redhat.com>
6c0556
Date:   Fri Dec 10 16:06:36 2021 +0100
6c0556
6c0556
    elf: Install a symbolic link to ld.so as /usr/bin/ld.so
6c0556
    
6c0556
    This makes ld.so features such as --preload, --audit,
6c0556
    and --list-diagnostics more accessible to end users because they
6c0556
    do not need to know the ABI name of the dynamic loader.
6c0556
    
6c0556
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
6c0556
6c0556
 Conflicts:
6c0556
	elf/Makefile
6c0556
	  (versioned shared objects downstream)
6c0556
6c0556
diff --git a/elf/Makefile b/elf/Makefile
6c0556
index b3e8ab2792608de7..c552aff350c2faac 100644
6c0556
--- a/elf/Makefile
6c0556
+++ b/elf/Makefile
6c0556
@@ -99,7 +99,7 @@ endif
6c0556
 ifeq (yes,$(build-shared))
6c0556
 extra-objs	= $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os
6c0556
 generated	+= librtld.os dl-allobjs.os ld.so ldd
6c0556
-install-others	= $(inst_rtlddir)/$(rtld-installed-name)
6c0556
+install-others	= $(inst_rtlddir)/$(rtld-installed-name) $(inst_bindir)/ld.so
6c0556
 install-bin-script = ldd
6c0556
 endif
6c0556
 
6c0556
@@ -622,6 +622,11 @@ $(inst_rtlddir)/$(rtld-installed-name): \
6c0556
 	$(make-target-directory)
6c0556
 	$(make-shlib-link)
6c0556
 
6c0556
+# Creates the relative /usr/bin/ld.so symbolic link.
6c0556
+$(inst_bindir)/ld.so: $(inst_rtlddir)/$(rtld-installed-name)
6c0556
+	$(make-target-directory)
6c0556
+	$(make-link)
6c0556
+
6c0556
 # Special target called by parent to install just the dynamic linker.
6c0556
 .PHONY: ldso_install
6c0556
 ldso_install: $(inst_rtlddir)/$(rtld-installed-name)