From nobody Wed Jul 10 21:28:34 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 4WK9vl0fpHz5RBky; Wed, 10 Jul 2024 21:28:35 +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 4WK9vk5x6Vz4GYb; Wed, 10 Jul 2024 21:28:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720646914; 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=vA45Iao6f0qSeevkKSwVI3MN7U4nKYxBa2sFvanMl28=; b=kXWWu90Ig16BxsUBJe1iK1Fk9d5pnzX86edbENCIe2XFD6xauD1RPxcmpljG16wNhS6/8a t3s2zm5KTVm84HYZvm0acdBnfWvVPmbDQzgywNHDDnUsGGEMzfwoiXdQfWwDLwwQq3wnNm MgQdz9+dC7DwMw2E4mUugKosvpAaRM+wSdXBu2KUa7uuQ6jZCheX0EOVmuOh5n+GUJqmAO LNmG4pF2U2AbXCZD0o5GTYoLyevebm+5S92h8XzlGXZHILmDXEByEK43ryFZFtMhBy4630 TodE+aOPx+Kv8fr1wXCsmyI4Pz/gJfOEHqMT3hiizX+a7Kg9t70M7Kt1FVasaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720646914; a=rsa-sha256; cv=none; b=CxLyHYj5LzNJ84j1QGNBVpXKTjMyVqOIkGv+vUWqxcsplNPexv3w0IFHJcA47pAT46Uk/g GJq1ec9T108hNe0wgQnBhj0Ra8qCkDcQeeJqLISkMBbxZIFx5Z96RnZKFsz160GPDCgRkg EbMudPKe02JMrEvXaRZUHzA7BC6WcSZbT3yt/IqpGirnEsTxJ/xmLa+GxFCKyKvGGz6mE9 UHU2/eWtiuCUp+wDsqgQ+FUNQpdNDbr3dEU8n/7GqrtwTkQ8ja8l/1/GB8G+47007YcYC+ tx7vF30Z2iUu3TTF6IIwAd+sOkZAjwmegWxoIOOi8iZ0JwpOh1fHK4YK+WeZ4A== 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=1720646914; 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=vA45Iao6f0qSeevkKSwVI3MN7U4nKYxBa2sFvanMl28=; b=ed2aduhkET5enwJq8pVloMzuA1xfG99bQdX4xYnk/w8RlshUVTFS50cE9acNIXNRIv+hCN bi++ZB6WIZ0OBB06X3oYoAPBBTZJod/yRKE+z9Ok9h7vYJyEqOGz3Fa/QzgIqYTsXkt2FM p5gHLLxur8mqpy7I2p1B8S6EIJ6lbCpnEWfm28OFYKtecHvkj3+UoMFWcdNsQuwXXOmFIr 6l8JSnQg/Jj7JD/Jl92WVIEZ5jq5X3zDNzheezb6q0snAXtzOpaXcSTr4X2IHFasKBqhFw YOMWsiPCLERvCmXFxNg8gd2QA5LChVu9VPVNo8lrjVTknh71mneeAXEbwl6btA== 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 4WK9vk5M8NzYR1; Wed, 10 Jul 2024 21:28:34 +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 46ALSYdC012490; Wed, 10 Jul 2024 21:28:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46ALSY0N012487; Wed, 10 Jul 2024 21:28:34 GMT (envelope-from git) Date: Wed, 10 Jul 2024 21:28:34 GMT Message-Id: <202407102128.46ALSY0N012487@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: 7bbcbd43c53b - main - libdtrace: Compute the relocation offset for all non-ET_REL objects 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: 7bbcbd43c53b49360969ca82b152fd6d971e9055 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7bbcbd43c53b49360969ca82b152fd6d971e9055 commit 7bbcbd43c53b49360969ca82b152fd6d971e9055 Author: Mark Johnston AuthorDate: 2024-07-10 21:21:54 +0000 Commit: Mark Johnston CommitDate: 2024-07-10 21:21:54 +0000 libdtrace: Compute the relocation offset for all non-ET_REL objects The use of an ifdef here most likely carries over from when the dtrace port only worked on x86 platforms. MFC after: 2 weeks Sponsored by: Innovate UK --- .../opensolaris/lib/libdtrace/common/dt_module.c | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c index 6fb9b0f84769..2a0386c33124 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c @@ -1251,19 +1251,21 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) * [Text][R/O data][R/W data][Dynamic][BSS][Non loadable] */ dmp->dm_text_size = dmp->dm_data_va - dmp->dm_text_va; -#if defined(__i386__) - /* - * Find the first load section and figure out the relocation - * offset for the symbols. The kernel module will not need - * relocation, but the kernel linker modules will. - */ - for (i = 0; gelf_getphdr(dmp->dm_elf, i, &ph) != NULL; i++) { - if (ph.p_type == PT_LOAD) { - dmp->dm_reloc_offset = k_stat->address - ph.p_vaddr; - break; + + if (!is_elf_obj) { + /* + * Find the first load section and figure out the relocation + * offset for the symbols. The kernel module will not need + * relocation, but the kernel linker modules will. + */ + for (i = 0; gelf_getphdr(dmp->dm_elf, i, &ph) != NULL; i++) { + if (ph.p_type == PT_LOAD) { + dmp->dm_reloc_offset = + k_stat->address - ph.p_vaddr; + break; + } } } -#endif if (dmp->dm_info.objfs_info_primary) dmp->dm_flags |= DT_DM_PRIMARY;