]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Extend PE header size to cover space up to first section
authorMichael Brown <mcb30@ipxe.org>
Mon, 27 Nov 2023 12:08:19 +0000 (12:08 +0000)
committerMichael Brown <mcb30@ipxe.org>
Mon, 27 Nov 2023 12:42:58 +0000 (12:42 +0000)
commita147245f1a2f92a85a75226ea921acb22322ab4d
tree60926cab917e2e6e46fb5c846d631f3e21bc6783
parentc3dd3168c916f624af1b843515c1305387060611
[efi] Extend PE header size to cover space up to first section

Hybrid bzImage and UEFI binaries (such as wimboot) may place sections
at explicit offsets within the PE file, as described in commit b30a098
("[efi] Use load memory address as file offset for hybrid binaries").
This can leave a gap after the PE headers that is not covered by any
section.  It is not entirely clear whether or not such gaps are
permitted in binaries submitted for Secure Boot signing.

To minimise potential problems, extend the PE header size to cover any
space before the first explicitly placed section.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/util/elf2efi.c