From nobody Thu Mar 21 15:34:18 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 4V0qJB6dS3z5Dt6d; Thu, 21 Mar 2024 15:34:18 +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 4V0qJB68K1z4m94; Thu, 21 Mar 2024 15:34:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711035258; 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=4M77rVnk/Pvje1slBfb2prfAFE1ms+7Pd2W+12UAn6A=; b=fIwCfjV/SSv4qZa4RYXj54VFKCsL7zXLnTEyaljdBR8uVe4eyKzqvtIF/NdqWZHbzX9BH7 +0U3KmpkWNitxAMEsFtNNtOEmbORB+TaSvu3rblmyKDyEwDqXHJEh57+hANiyBGNjfDUr1 F205fAgKsdeYizw1zhFsWTxmX4yqPIpYGisBys0dEM6U2iDdALRAAOiwhf9ErWoj1tl2np G1tjljnFFUjoS2Z5GsnubuSGvpNzu/FKEO80S5IQHdrb/bNuJl8LL5tpYKs1a5SrC7J9sL hB9UF1OOQ0TkMisfzKzzaJHeN8pqTRJKtwfosJqIgUHg5+dtofZoGRy1sRAwRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711035258; a=rsa-sha256; cv=none; b=mzT2K1+Fot2I7mnJV/Dfd2TkTTMflm10tD5CHx/hYLN1G/WetVCY93Gx628slP/oefDPiY 2V6l6kyS3KhZnEcGVbIth0jhwSkRtkWCqJuMxceAK3zGRFDNn6dJ/SeJB0QuoENx+wfQe4 kJ9E44Ok0n8xNx/eEts6MpBLBIajJViVJg/S2BPkQhmvgplfNqY4ykQUwWpseF5JLv6En3 QkmLb3exB28oqSnnxHHqpFTHbsnhwmO5dctG+48/+TW0pmRxcNi86Qv3jnPbkhztKaOP4w Ut/CfzmU2/EhAQOvNywnUQy252XUizyj7OdzLN7CZEPqApixH9LYqb2/rItCHQ== 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=1711035258; 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=4M77rVnk/Pvje1slBfb2prfAFE1ms+7Pd2W+12UAn6A=; b=a+Beab8JnCipi+K07h07n3Zv95LOwMs5+e9BxGbmdxHSkx78tc/6x1cUqM4CnvnBgYJvfZ Rhmjh78gmJhiXLz751c7wBMZZP6xN+JdwAWWxFu+t5laChbloUfwenmPyQxpm15GfHfzZk fB/BNVHWQyMR36EqQDJm9SUV0z3DBYE4tA7c/pHjHG8kYKIjr0qNkC4UVUqbQEqDsupVve CuIUMX1sEwZLrq95q4zmhYJB6RbKLWnaPT6ycvUxUEjgwceLd85zlwlWt00ili3buQSBEZ 4UhhDnsctex9mK7vE0ALGnrMo8GR2Es1xr4ycHx4SCxnrHRMuDNU/tehfQ98Ag== 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 4V0qJB5lWRzgnD; Thu, 21 Mar 2024 15:34:18 +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 42LFYIPP072405; Thu, 21 Mar 2024 15:34:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42LFYIDp072402; Thu, 21 Mar 2024 15:34:18 GMT (envelope-from git) Date: Thu, 21 Mar 2024 15:34:18 GMT Message-Id: <202403211534.42LFYIDp072402@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 173953182af0 - main - rtld-elf: add some debug print statements 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 173953182af060dcab43990e179ee91e9f2d1e54 Auto-Submitted: auto-generated The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=173953182af060dcab43990e179ee91e9f2d1e54 commit 173953182af060dcab43990e179ee91e9f2d1e54 Author: Stefan Eßer AuthorDate: 2024-03-21 15:31:49 +0000 Commit: Stefan Eßer CommitDate: 2024-03-21 15:31:49 +0000 rtld-elf: add some debug print statements The byte-order independent code has been reported to fail on powerpc64. Add some more debug statements to help identify the parametrs used and to verify the correct operation of the byte-swap macros used.. --- libexec/rtld-elf/rtld.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 4b6d19104343..fbf5b3e20a1f 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -2109,6 +2109,11 @@ cleanup1: return (NULL); } is_le = /*le32toh(1) == 1 || */ hdr.magic == ELFHINTS_MAGIC; + dbg("host byte-order: %s-endian", le32toh(1) == 1 ? "little" : "big"); + dbg("hints file byte-order: %s-endian", is_le ? "little" : "big"); + dbg("verify swap macros: le32toh(0x12345678) == %#010x, " + "be32toh(0x12345678) == %#010x", + le32toh(0x12345678), be32toh(0x12345678)); magic = COND_SWAP(hdr.magic); version = COND_SWAP(hdr.version); strtab = COND_SWAP(hdr.strtab);