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