From nobody Thu Aug 22 19:36:57 2024 X-Original-To: dev-commits-src-main@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 4WqYP563RWz5TWKD; Thu, 22 Aug 2024 19:36:57 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WqYP55TkFz4Q5N; Thu, 22 Aug 2024 19:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724355417; 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=5owFQc08hLO3EsaoRPqQQ/1JoLUqZsWe1LzTAF1TC/U=; b=s+t1/2a6PM95t2+HyNeyTMKcUj8ftPTFYxpQfxNqVbQSimzpxmoV96PQ8FmcFvg1djHaZB +nliP4KI0xBkoQlis/P56XKSOYgxUshaCnASmZy3FUdsQgKV16cVacVJ190xDF1HbCJZ3a skv7htt4xKCnI0yNvgpzb9JONRU631Cg9TmyHjV5iB/Xydz8+kZ5Ox56dDdURYjIZAddRT fafutho5ztuCSKrerXjVAekmnbvCb9bDbvxSSTvOR2q47QtiCK55S8oI0s1Yv3Pxb+uRq3 /9HzCmopk7BpGh1vVsETuJND9ybwqd+zwT0ARjfXmzh2WJMbRinhDXIiZauK7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724355417; a=rsa-sha256; cv=none; b=OPIcBTNQCwWvyvmoWTb3axTDU0/rokLuwSUCHikj+JknIGmu4CR7HHYGnvVmSR6+xpum4M /+32I+ltiOeOmpTuM9DXfBm05edfMWFg9R9ipTX9ojcRVtQIJdWmZjv8swiUCJmgOJv2db DV8DaLktF0IaLWXtDcxHHpXxgyIWqUU9bK4JpZNxDHOaR7SKhm+9CS5sWZ8XofxnD8Fs9m H/MKu8kEqJ6F7RWRdas80HLD3TLCZhAgphUBqAqN1I7UibrITXckBTVBN0xF4P+uig599M HmEO3Pn4ti5NKTjfbBsa4MMl7R/Gn88SqtsbIC7kb4ta4fgzjpbbPCES1bsG2w== 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=1724355417; 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=5owFQc08hLO3EsaoRPqQQ/1JoLUqZsWe1LzTAF1TC/U=; b=rZnR0WZxnqabpZc6Xkm/Jl+egkmuqH+gp5vo8Ilvzm0YicwOuAunV6z5CBpRR4M2P0KzAi ZpEOdMyr0TGDFjvDBYGPDovzBci/V6mpm9qiAsCgOlsyJR2iA3jQCNYh4m3ilQ8AcJtRwV awmJGgjLtO52j85nbKfXvbEd1DjCbReHWxLOm3usx9uIoVhSdH7nIipHyc4IKJJnPKgoBW Ewha7FEGZ0VeEG7o2Rx+hsVrhdXRBYWYt91P74ywL3Wio0qiEKdcm09iZ6JdRuLmdJg9Pk 9HVNwYK7ldcqUwG9fG35P76QbCq7ZP+baQtlewApFGlBLSwEXXe9qViEO/pfYg== 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 4WqYP5528tzh1Z; Thu, 22 Aug 2024 19:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47MJav01034779; Thu, 22 Aug 2024 19:36:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47MJavV9034776; Thu, 22 Aug 2024 19:36:57 GMT (envelope-from git) Date: Thu, 22 Aug 2024 19:36:57 GMT Message-Id: <202408221936.47MJavV9034776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 33658afd4e4d - main - rtld-elf: Pass parsed aux_info to ifunc_init List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33658afd4e4d11cd71d92e52ca9da5381cdd829b Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=33658afd4e4d11cd71d92e52ca9da5381cdd829b commit 33658afd4e4d11cd71d92e52ca9da5381cdd829b Author: Jessica Clarke AuthorDate: 2024-08-22 19:36:44 +0000 Commit: Jessica Clarke CommitDate: 2024-08-22 19:36:44 +0000 rtld-elf: Pass parsed aux_info to ifunc_init Currently we pass the raw pointer to the on-stack auxargs. This can legitimately have fewer than AT_COUNT entries, so the use of __min_size(AT_COUNT), i.e. static AT_COUNT, is inaccurate, and also needlessly forces the callee to iterate over the elements to find the entry for a given type. Instead we can just pass aux_info like we use for everything else. Note that the argument has been left unused by every callee since its introduction in 4352999e0e6c ("Pass CPUID[1] %edx (cpu_feature), %ecx (cpu_feature2) and CPUID[7].%ebx (cpu_stdext_feature), %ecx (cpu_stdext_feature2) to the ifunc resolvers on x86.") Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46276 --- libexec/rtld-elf/aarch64/reloc.c | 2 +- libexec/rtld-elf/amd64/reloc.c | 2 +- libexec/rtld-elf/arm/reloc.c | 2 +- libexec/rtld-elf/i386/reloc.c | 2 +- libexec/rtld-elf/powerpc/reloc.c | 2 +- libexec/rtld-elf/powerpc64/reloc.c | 2 +- libexec/rtld-elf/riscv/reloc.c | 2 +- libexec/rtld-elf/rtld.c | 2 +- libexec/rtld-elf/rtld.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index f76ce7f4d580..3687c9385326 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -452,7 +452,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 9c5887def356..2e24d6287ea3 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -499,7 +499,7 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flags, RtldLockState *lockstate) uint32_t cpu_feature, cpu_feature2, cpu_stdext_feature, cpu_stdext_feature2; void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { u_int p[4], cpu_high; diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c index 4683ebf74fee..b10e6ce844d5 100644 --- a/libexec/rtld-elf/arm/reloc.c +++ b/libexec/rtld-elf/arm/reloc.c @@ -442,7 +442,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index 04a8354343bc..c91239eb3989 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -464,7 +464,7 @@ rtld_cpuid_count(int idx, int cnt, u_int *p) } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { u_int p[4], cpu_high; int cpuid_supported; diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index 5618efb7f716..82a9669e3e73 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -813,7 +813,7 @@ powerpc_abi_variant_hook(Elf_Auxinfo** aux_info) } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index 2d06d5821d1b..70acd0ac390d 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -710,7 +710,7 @@ powerpc64_abi_variant_hook(Elf_Auxinfo** aux_info) } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 43522a5a790f..5ea005a813cb 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -376,7 +376,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, } void -ifunc_init(Elf_Auxinfo aux_info[__min_size(AT_COUNT)] __unused) +ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) { } diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 1f0c59722ac6..a8db1198a899 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -904,7 +904,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) exit (0); } - ifunc_init(aux); + ifunc_init(aux_info); /* * Setup TLS for main thread. This must be done after the diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 656e980c6261..5527671d647e 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -438,7 +438,7 @@ int reloc_jmpslots(Obj_Entry *, int flags, struct Struct_RtldLockState *); int reloc_iresolve(Obj_Entry *, struct Struct_RtldLockState *); int reloc_iresolve_nonplt(Obj_Entry *, struct Struct_RtldLockState *); int reloc_gnu_ifunc(Obj_Entry *, int flags, struct Struct_RtldLockState *); -void ifunc_init(Elf_Auxinfo[__min_size(AT_COUNT)]); +void ifunc_init(Elf_Auxinfo *[__min_size(AT_COUNT)]); void init_pltgot(Obj_Entry *); void allocate_initial_tls(Obj_Entry *);