]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Write out PE header only after writing sections
authorMichael Brown <mcb30@ipxe.org>
Wed, 22 Nov 2023 15:38:22 +0000 (15:38 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 23 Nov 2023 13:37:47 +0000 (13:37 +0000)
commitcc858acd3205b18934ffff19ac55f8987e9c6135
tree36c4e8eea840c42e3c803bf7d04407ad03ae4858
parentb30a0987e239baf4689adbf79035b7f737eef873
[efi] Write out PE header only after writing sections

Hybrid bzImage and UEFI binaries (such as wimboot) include a bzImage
header within a section starting at offset zero, with the PE header
effectively occupying unused space within this section.

Allow for this by treating a section placed at offset zero as hidden,
and by deferring the writing of the PE header until after the output
sections have been written.

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