From nobody Fri May 17 10:21:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgjgL5ykzz5Kw3b; Fri, 17 May 2024 10:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgjgL5CkYz53Xq; Fri, 17 May 2024 10:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715941310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M0jb7vEoMIUGsMkuwKLRL7XvTm1PTBPFGJQ1yn3Kfi8=; b=gS7eeGUC9ju1bj4GJYa2aNMSPgRMDgDquXBDfrhZBRRcrAED7/Aww7tnfeiq8pZVDSErcG /G1KexfXHD/VUGRQEp4yHwZ03JIPxoAJ2dj03Thyn52raOuYNM3ULmyhZfOFuSCFNJmLuA 6lx1Ht9jh2IKbwk0yYFZdSuZXrwUlZEfwRf1HSZ/442R7uD4bwyuJhuNjeVvdgG+YP9WaU t4P/QyIhjpGLWNJK9HmyJbE7fI0tAbD3hraSSfBBJ+N9ZspzX3lPWygIuRvio9ZqduhQVC o3shsjkA2h9RvEWVPbGLkqHELROC2bV+SN/6582KGQmopbFpZc3lUUMt2YLbaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715941310; a=rsa-sha256; cv=none; b=A6yWFBw5EPne/S1KUhj+Rl6fyYMZO/fpYjgnqUTogrQa1NhMxPLoMgR9OBDvKcvnaX+XEN +F43vwDAuYF8qxIU32EV5JzaO2T4dvsDwNJs27MtxKpQjKSaCv+Oy3EeTZOp7K+9XKrHeA spZWcSkokGi0tFMMPNtmJ5vrcgHl/53U3y7NDk/tb/Eq/EO1YmEUDxilAgeN/fAIfn/QE0 vv1oUxVBupt8D8jCRvN7bbAsLqa2ygxq+kTaEV0HngYWpZte/4cMtetkIjH+V2cEIn8H0B c6RkGq0n5hNgjt0FWEbDKsEuPRuT2wxk84tVyB7FaD2C2di2kO23QWw42xpJeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715941310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M0jb7vEoMIUGsMkuwKLRL7XvTm1PTBPFGJQ1yn3Kfi8=; b=x44mCV+yKmOmir6ZjiEhyP6rzI6r1SIwNuHh7lDdLW3DW6HvKxPu8ROoSJ8YYgc0V4vx1I HYPjYvOkYJsJ0SeTfk1uQQMZN7VSV9b5KNuJvcJSZRjd79fMo2nbzl62kZj3SS8rKD0Z0t FGzVsop15cUleIKk00l/+4A97iKbgfRJXDRmO6VwL6EoKVJ6sFblklusYZKHnMFpf14A8y hEEvd0YvTeL+kNeo1DT1/3GtvSwcF7wVMlIrReLq2FbQ5FK+eBjeWFSyO+nqDtkFkb+zfr c1vZbEh3l29dBtnIH3bRNc/Vf8KywnHTWRThFp9RUixkkLANhbzZe36ok/bncA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgjgL4pxhzfLC; Fri, 17 May 2024 10:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44HALoFc069647; Fri, 17 May 2024 10:21:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HALobq069644; Fri, 17 May 2024 10:21:50 GMT (envelope-from git) Date: Fri, 17 May 2024 10:21:50 GMT Message-Id: <202405171021.44HALobq069644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: dd4155bec744 - main - rtld: Add arch_digest_dynamic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd4155bec744acf2ebfd037f7719c4aed9283a73 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=dd4155bec744acf2ebfd037f7719c4aed9283a73 commit dd4155bec744acf2ebfd037f7719c4aed9283a73 Author: Andrew Turner AuthorDate: 2024-05-07 16:14:47 +0000 Commit: Andrew Turner CommitDate: 2024-05-17 09:37:12 +0000 rtld: Add arch_digest_dynamic This will be used to handle the DT_AARCH64_VARIANT_PCS tag. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45117 --- libexec/rtld-elf/aarch64/rtld_machdep.h | 3 +++ libexec/rtld-elf/amd64/rtld_machdep.h | 3 +++ libexec/rtld-elf/arm/rtld_machdep.h | 3 +++ libexec/rtld-elf/i386/rtld_machdep.h | 3 +++ libexec/rtld-elf/powerpc/rtld_machdep.h | 3 +++ libexec/rtld-elf/powerpc64/rtld_machdep.h | 3 +++ libexec/rtld-elf/riscv/rtld_machdep.h | 3 +++ libexec/rtld-elf/rtld.c | 3 +++ 8 files changed, 24 insertions(+) diff --git a/libexec/rtld-elf/aarch64/rtld_machdep.h b/libexec/rtld-elf/aarch64/rtld_machdep.h index a3031fe7e539..347ef5f381fe 100644 --- a/libexec/rtld-elf/aarch64/rtld_machdep.h +++ b/libexec/rtld-elf/aarch64/rtld_machdep.h @@ -47,6 +47,9 @@ struct Struct_Obj_Entry; (const Elf_Dyn *)_dynamic_addr; \ }) +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + bool arch_digest_note(struct Struct_Obj_Entry *obj, const Elf_Note *note); Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, diff --git a/libexec/rtld-elf/amd64/rtld_machdep.h b/libexec/rtld-elf/amd64/rtld_machdep.h index 558c0a73123f..1797d13c847d 100644 --- a/libexec/rtld-elf/amd64/rtld_machdep.h +++ b/libexec/rtld-elf/amd64/rtld_machdep.h @@ -41,6 +41,9 @@ struct Struct_Obj_Entry; Elf_Dyn *rtld_dynamic_addr(void); #define rtld_dynamic(obj) rtld_dynamic_addr() +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/arm/rtld_machdep.h b/libexec/rtld-elf/arm/rtld_machdep.h index a492ac0eab77..f59b30028a3b 100644 --- a/libexec/rtld-elf/arm/rtld_machdep.h +++ b/libexec/rtld-elf/arm/rtld_machdep.h @@ -41,6 +41,9 @@ struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) (&_DYNAMIC) +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/i386/rtld_machdep.h b/libexec/rtld-elf/i386/rtld_machdep.h index f39300d16ddb..581f1dfb002d 100644 --- a/libexec/rtld-elf/i386/rtld_machdep.h +++ b/libexec/rtld-elf/i386/rtld_machdep.h @@ -41,6 +41,9 @@ struct Struct_Obj_Entry; #define rtld_dynamic(obj) \ ((const Elf_Dyn *)((obj)->relocbase + (Elf_Addr)&_DYNAMIC)) +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/powerpc/rtld_machdep.h b/libexec/rtld-elf/powerpc/rtld_machdep.h index 03ef11f4034b..69fc52369201 100644 --- a/libexec/rtld-elf/powerpc/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc/rtld_machdep.h @@ -40,6 +40,9 @@ struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) (&_DYNAMIC) +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/powerpc64/rtld_machdep.h b/libexec/rtld-elf/powerpc64/rtld_machdep.h index f36be944e80a..d1dab63d3779 100644 --- a/libexec/rtld-elf/powerpc64/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc64/rtld_machdep.h @@ -40,6 +40,9 @@ struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) (&_DYNAMIC) +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/riscv/rtld_machdep.h b/libexec/rtld-elf/riscv/rtld_machdep.h index 2244a424f8c1..fb5f5643efc6 100644 --- a/libexec/rtld-elf/riscv/rtld_machdep.h +++ b/libexec/rtld-elf/riscv/rtld_machdep.h @@ -54,6 +54,9 @@ uint64_t set_gp(struct Struct_Obj_Entry *obj); (const Elf_Dyn *)_dynamic_addr; \ }) +/* No arch-specific dynamic tags */ +#define arch_digest_dynamic(obj, dynp) false + /* No architecture specific notes */ #define arch_digest_note(obj, note) false diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 5743bbdd6f61..20c340ed15a3 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1554,6 +1554,9 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath, break; default: + if (arch_digest_dynamic(obj, dynp)) + break; + if (!early) { dbg("Ignoring d_tag %ld = %#lx", (long)dynp->d_tag, (long)dynp->d_tag);