From: Mark Wielaard Date: Wed, 21 Feb 2024 20:59:14 +0000 (+0100) Subject: libebl: ebl_object_note print 32bit annobin address ranges correctly X-Git-Tag: elfutils-0.191~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22085a89e31b6d4a9c528210a4c959a46a4b83f5;p=thirdparty%2Felfutils.git libebl: ebl_object_note print 32bit annobin address ranges correctly 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 --- diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c index 5a7c5c62e..1ba5d8b32 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 {