From patchwork Fri Dec 10 09:48:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 48762 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 55A8E3858C27 for ; Fri, 10 Dec 2021 09:48:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55A8E3858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1639129728; bh=IUJB4sDeGCAJLBX8eLLoQ05l3u8OCaPv4Lvpys1hNDE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=dJT3mgdxwpQ040L7q+OEYk+KswlTFOTEtV0aMnPYWR6u9z37sH1ZS4dGbGA+Q1sI+ uEXcx5lo4spKZ+5wV2ugRYebAONvdcIKuBkcERIK5juLtN42W6BzPv3ILM6rjjftcs BKuuLk+cNPW+xlqWDW8wAtP46x5N4+ap5JfDz/7g= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 16DEC3858D35 for ; Fri, 10 Dec 2021 09:48:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 16DEC3858D35 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-287-3UkXEZZyPwKziA8YDrvbSw-1; Fri, 10 Dec 2021 04:48:24 -0500 X-MC-Unique: 3UkXEZZyPwKziA8YDrvbSw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F77681EE60 for ; Fri, 10 Dec 2021 09:48:23 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A98BE45D89 for ; Fri, 10 Dec 2021 09:48:22 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH v3] elf: Install a symbolic link to ld.so as /usr/bin/ld.so Date: Fri, 10 Dec 2021 10:48:21 +0100 Message-ID: <8735n0dc4a.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "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. Reviewed-by: Carlos O'Donell --- v2: Use $(make-link). v3: Update NEWS entry. NEWS | 3 +++ elf/Makefile | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 8744a92532..3a04befe8e 100644 --- a/NEWS +++ b/NEWS @@ -79,6 +79,9 @@ Major new features: variables. The GNU C Library manual has details on integration of 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: * The r_version update in the debugger interface makes the glibc binary diff --git a/elf/Makefile b/elf/Makefile index ef36008673..d0bb0daa7e 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 @@ -692,6 +692,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)