elf: Install a symbolic link to ld.so as /usr/bin/ld.so

This makes ld.so features such as --preload, --audit,
and --list-diagnostics more accessible to end users because they
do not need to know the ABI name of the dynamic loader.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Florian Weimer 2021-12-10 16:06:36 +01:00
parent 5cc3385654
commit 2e75604f83
2 changed files with 9 additions and 1 deletions

3
NEWS
View File

@ -79,6 +79,9 @@ Major new features:
variables. The GNU C Library manual has details on integration of variables. The GNU C Library manual has details on integration of
Restartable Sequences. Restartable Sequences.
* A symbolic link to the dynamic linker is now installed under
/usr/bin/ld.so (or more precisely, '${bindir}/ld.so').
Deprecated and removed features, and other changes affecting compatibility: Deprecated and removed features, and other changes affecting compatibility:
* The r_version update in the debugger interface makes the glibc binary * The r_version update in the debugger interface makes the glibc binary

View File

@ -110,7 +110,7 @@ endif
ifeq (yes,$(build-shared)) ifeq (yes,$(build-shared))
extra-objs = $(all-rtld-routines:%=%.os) sofini.os interp.os extra-objs = $(all-rtld-routines:%=%.os) sofini.os interp.os
generated += librtld.os dl-allobjs.os ld.so ldd generated += librtld.os dl-allobjs.os ld.so ldd
install-others = $(inst_rtlddir)/$(rtld-installed-name) install-others = $(inst_rtlddir)/$(rtld-installed-name) $(inst_bindir)/ld.so
install-bin-script = ldd install-bin-script = ldd
endif endif
@ -692,6 +692,11 @@ $(inst_rtlddir)/$(rtld-installed-name): $(objpfx)ld.so $(+force)
$(make-target-directory) $(make-target-directory)
$(do-install-program) $(do-install-program)
# Creates the relative /usr/bin/ld.so symbolic link.
$(inst_bindir)/ld.so: $(inst_rtlddir)/$(rtld-installed-name)
$(make-target-directory)
$(make-link)
# Special target called by parent to install just the dynamic linker. # Special target called by parent to install just the dynamic linker.
.PHONY: ldso_install .PHONY: ldso_install
ldso_install: $(inst_rtlddir)/$(rtld-installed-name) ldso_install: $(inst_rtlddir)/$(rtld-installed-name)