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