From nobody Sat Jan 25 16:02:59 2025 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 4YgKGD04brz5lY7d; Sat, 25 Jan 2025 16:03:00 +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 4YgKGC6SFBz4BLP; Sat, 25 Jan 2025 16:02:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737820979; 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=14im0GGkfkhSF2R4qblpXX9T9z/OYUbgvrfl6hPEW8g=; b=VLHa7/RAGYUk976TjAsbzx/A4zyAHiEyIVm/+8c61Vt6x0gceTZgdetlYscxARzsLnC9gB WvME0VInZyR/+6xu0VebDEUJ1xf8kYsWmFW0RrkzCwWwxEK/iMxpZF9yACmC3xEsHFkgFs Xn5518X1lITcFgO39AkNvmsxNd+//WoKLQwjpVRoO0NhRk7dVv0KMQLD4gnnK+MBXKawBV EBgC+DG7D2bnjzvCnLAEQiQyz74fUuVn1felJTqG520dqewXu0EBtYiNIjFpcjz08+Ef2B ipij4MwKRQLekGUc7MoEo3/fc+ROULlIRJqkVRNwbzrSTIUKFeMBPkOGfDTtCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737820979; 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=14im0GGkfkhSF2R4qblpXX9T9z/OYUbgvrfl6hPEW8g=; b=pic3AxN2j6yeT5TdCtHi0XLFYNE34utcEwGkSGa2BzW2koOmz07x5ImphA/UUR3DjW+NlO CH6ViKVcpg2CEtnsJ3d66YU7qGtWPjOSfYvLrgX5dKLHy/yyyIa71shbKun08Tx4fAg9HM Tb5VwxMjXW9Esfd+aT8du8fZzLwe7BQh09akx86pke4zQak9DttZn90kShsGDly654AWLd Cg25YDjHGf8RfS5QmGwCZx1CoMFwTJhQWgjU5kl29NSmCzQvKYcGIe/Zvf/VEuy7OueLDD A98NyIhfyjCLFizmXF+xPq5TJrAbTy+Bri3sOwXihl9/VbFTNre4ScRI62fMbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737820979; a=rsa-sha256; cv=none; b=kXzSkty2D0ZpUWaY47ocPFabRqYpmqpJ6CE45wtvaSp6rwN4FizRy5ZIM9ygVmhYFpFead /FN6Nl3kKAMWgdjaia59hP06vsraMvx0dgsGs0tnhRkpOSTyCIOHf80+6fc8Ou0UjEg+2P 37Uf6nrPdZWZ1vbkXKQz1CqYeHq5QqkLCSP8nueTTo28kyRv4VzFAT/0yk9ZzEBVrMdLiC a2vJ3DyeHBw+IEDAuYShddGD5MurhSoBRaGrkoCrJYkVLAM9KOki3Kxkp7GYq2CVNEuPaV 7UhhAT1Qi5L6cekgq3MvRRkZynnw25+8o6KBG6WPSscIbOQZz+c/hETbaPKhmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YgKGC5vbbz1J6y; Sat, 25 Jan 2025 16:02:59 +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 50PG2xwX076809; Sat, 25 Jan 2025 16:02:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PG2xLk076806; Sat, 25 Jan 2025 16:02:59 GMT (envelope-from git) Date: Sat, 25 Jan 2025 16:02:59 GMT Message-Id: <202501251602.50PG2xLk076806@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 096a5c6cd28c - main - libdtrace: Generalize handling of data models a bit 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 096a5c6cd28c417456d5ce3598be15e6b656af5c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=096a5c6cd28c417456d5ce3598be15e6b656af5c commit 096a5c6cd28c417456d5ce3598be15e6b656af5c Author: Mark Johnston AuthorDate: 2025-01-25 15:57:37 +0000 Commit: Mark Johnston CommitDate: 2025-01-25 16:02:41 +0000 libdtrace: Generalize handling of data models a bit Make it easier to support data models other than ILP32 and LP64 by avoiding constructs which assume that it must be one or the other. No functional change intended. MFC after: 2 weeks Sponsored by: Innovate UK --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.c | 7 +++---- cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c | 8 +++++++- cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c index dc68c6ef5f72..162224478ec0 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c @@ -1378,7 +1378,7 @@ main(int argc, char *argv[]) argv[0], optarg); return (usage(stderr)); } - g_oflags &= ~DTRACE_O_LP64; + g_oflags &= ~DTRACE_O_MODEL_MASK; g_oflags |= DTRACE_O_ILP32; break; @@ -1389,7 +1389,7 @@ main(int argc, char *argv[]) argv[0], optarg); return (usage(stderr)); } - g_oflags &= ~DTRACE_O_ILP32; + g_oflags &= ~DTRACE_O_MODEL_MASK; g_oflags |= DTRACE_O_LP64; break; @@ -1460,8 +1460,7 @@ main(int argc, char *argv[]) * files. We ignore certain errors since we'll catch them later when * we actually process the object files. */ - if (g_mode == DMODE_LINK && - (g_oflags & (DTRACE_O_ILP32 | DTRACE_O_LP64)) == 0 && + if (g_mode == DMODE_LINK && (g_oflags & DTRACE_O_MODEL_MASK) == 0 && elf_version(EV_CURRENT) != EV_NONE) { int fd; Elf *elf; diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c index 8f8d20298e4c..40200771fd4d 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c @@ -1073,8 +1073,14 @@ dt_vopen(int version, int flags, int *errp, if (flags & ~DTRACE_O_MASK) return (set_open_errno(dtp, errp, EINVAL)); - if ((flags & DTRACE_O_LP64) && (flags & DTRACE_O_ILP32)) + switch (flags & DTRACE_O_MODEL_MASK) { + case 0: /* native model */ + case DTRACE_O_ILP32: + case DTRACE_O_LP64: + break; + default: return (set_open_errno(dtp, errp, EINVAL)); + } if (vector == NULL && arg != NULL) return (set_open_errno(dtp, errp, EINVAL)); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h index b380f5eb3313..1f4c5a2efd6b 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h @@ -70,6 +70,7 @@ typedef struct dtrace_aggdata dtrace_aggdata_t; #define DTRACE_O_NOSYS 0x02 /* do not load /system/object modules */ #define DTRACE_O_LP64 0x04 /* force D compiler to be LP64 */ #define DTRACE_O_ILP32 0x08 /* force D compiler to be ILP32 */ +#define DTRACE_O_MODEL_MASK (DTRACE_O_LP64 | DTRACE_O_ILP32) #define DTRACE_O_MASK 0x0f /* mask of valid flags to dtrace_open */ extern dtrace_hdl_t *dtrace_open(int, int, int *);