From b3bf1a021b59cd0d5f5bc39cf7e2610dc1059c56 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 30 Sep 2026 13:08:24 +0200 Subject: [PATCH] x86/mkelf32: correct VA/PA of PT_NOTE / .note For the .p_paddr, .p_vaddr, and .sh_addr fields the image load base (passed in by command line argument) also needs taking into account. It is _not_ merely the delta between incoming PT_NOTE and PT_LOAD segments. (The fields aren't really used anywhere, so this is largely a cosmetic issue; static analysis tools may be affected, though.) Fixes: a353cab905af ("build_id: Provide ld-embedded build-ids") Reported-by: Barr Detwix Signed-off-by: Jan Beulich Reviewed-by: Ross Lagerwall Acked-by: Andrew Cooper master commit: 19d3c4825d338a5667f4f9286c58e86001452476 master date: 2026-09-28 14:27:11 +0200 --- xen/arch/x86/boot/mkelf32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/boot/mkelf32.c b/xen/arch/x86/boot/mkelf32.c index 469d1ba0af..044bbcb0c1 100644 --- a/xen/arch/x86/boot/mkelf32.c +++ b/xen/arch/x86/boot/mkelf32.c @@ -360,7 +360,7 @@ int main(int argc, char **argv) (void)lseek(infd, offset, SEEK_SET); note_sz = in64_phdr.p_memsz; - note_base = in64_phdr.p_vaddr - note_base; + note_base = in64_phdr.p_vaddr - note_base + loadbase; if ( in64_phdr.p_offset < offset || in64_phdr.p_offset + in64_phdr.p_filesz > offset + dat_siz )