From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 20D693858435 for ; Wed, 21 Feb 2024 21:42:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 20D693858435 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 20D693858435 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=45.83.234.184 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708551779; cv=none; b=qIGXlwuzLTamRuyvCe7mVlaYn7bc44aJrLa+eYbMjcC+604dfazs8rygRmFF8RGUluHzZV1iql0jXIC+ih5nFJ7IP6WWTFOX+aQKS6jkMW8u5Gx4g+eUCgyyMZWIIf/KfQvH0TLf1Zmeg9oMXRlkM4DXiDkTuWGzzgESwr3tG6I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708551779; c=relaxed/simple; bh=Qd0XItma3uCZo98M6+sPPatnhR+THBe/UaVNPUAvW7k=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=E/odu0x3unehovr7W6AoXrgaEch6Ecx8lrcNRG1oCp3699S5nuZizCmnYtD7xBPoRJGzoen35wV3KJc6mL2EJdsnV0r7HfAQlT0tj19aMcbQx27eQsjZB/Fkkt/smaZ7bRJQsLz8vgkXFiluaOuBlY0C1PLopn9yeaLx8c4ckjQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from csb.redhat.com (deer0x03.wildebeest.org [172.31.17.133]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 83C233000472; Wed, 21 Feb 2024 22:42:55 +0100 (CET) Received: by csb.redhat.com (Postfix, from userid 10916) id 76A59DB3F5; Wed, 21 Feb 2024 21:59:17 +0100 (CET) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [PATCH] libebl: ebl_object_note print 32bit annobin address ranges correctly Date: Wed, 21 Feb 2024 21:59:14 +0100 Message-Id: <20240221205914.2144167-1-mark@klomp.org> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Annobin address ranges were always printed as if they were 64bit wide because addr_size was set to twice the size. This was done because the note description size should contain two addresses. Fix this by setting the address size to just one address and then check that descsz is twice that. * libebl/eblobjnote.c (ebl_object_note): Set addr_size to one ELF_T_ADDR. Check descsz equals two times addr_size. Signed-off-by: Mark Wielaard --- libebl/eblobjnote.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c index 5a7c5c62..1ba5d8b3 100644 --- a/libebl/eblobjnote.c +++ b/libebl/eblobjnote.c @@ -155,8 +155,8 @@ ebl_object_note (Ebl *ebl, uint32_t namesz, const char *name, uint32_t type, } addrs; size_t addr_size = gelf_fsize (ebl->elf, ELF_T_ADDR, - 2, EV_CURRENT); - if (descsz != addr_size) + 1, EV_CURRENT); + if (descsz != addr_size * 2) printf ("\n"); else { -- 2.39.3