[PATCH v2] elf: Install a symbolic link to ld.so as /usr/bin/ld.so

Florian Weimer fweimer@redhat.com
Tue Nov 23 15:56:13 GMT 2021


* Florian Weimer via Libc-alpha:

> 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.
>
> ---
> v2: Use $(make-link).
>  NEWS         | 4 ++++
>  elf/Makefile | 7 ++++++-
>  2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/NEWS b/NEWS
> index f10971b180..2f56f3db28 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -68,6 +68,10 @@ Major new features:
>    to be used by compilers for optimizing usage of 'memcmp' when its
>    return value is only used for its boolean status.
>  
> +* A symbolic link to the dynamic linker is now installed under
> +  /usr/bin/ld.so (or ${bindir}/ld.so if glibc is not configured with
> +  --prefix=/usr).
> +
>  Deprecated and removed features, and other changes affecting compatibility:
>  
>  * The r_version update in the debugger interface makes the glibc binary
> diff --git a/elf/Makefile b/elf/Makefile
> index 72004484db..06cfde778c 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -110,7 +110,7 @@ endif
>  ifeq (yes,$(build-shared))
>  extra-objs	= $(all-rtld-routines:%=%.os) sofini.os interp.os
>  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
>  endif
>  
> @@ -682,6 +682,11 @@ $(inst_rtlddir)/$(rtld-installed-name): $(objpfx)ld.so $(+force)
>  	$(make-target-directory)
>  	$(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.
>  .PHONY: ldso_install
>  ldso_install: $(inst_rtlddir)/$(rtld-installed-name)

Ping?  This patch needs review.  Do we want to make this change?

Thanks,
Florian



More information about the Libc-alpha mailing list