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: a353cab905 ("build_id: Provide ld-embedded build-ids")
Reported-by: Barr Detwix <timotheecisnard@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 19d3c4825d
master date: 2026-09-28 14:27:11 +0200
This commit is contained in:
Jan Beulich committed 2026-09-30 13:08:24 +02:00
1 parent b3b2fce742
commit b3bf1a021b
1 file changed
+1 -1
+1 -1
View File
@@ -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 )
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.