Skip to content

[efi] Place debug directory within .rodata section - #1852

Merged
mcb30 merged 1 commit into
ipxe:masterfrom
mcb30:debugdir
Sep 29, 2026
Merged

mcb30 merged 1 commit into
ipxe:masterfrom
mcb30:debugdir

Conversation

@mcb30

@mcb30 mcb30 commented Sep 29, 2026

Copy link
Copy Markdown
Member

Some strict PE parsers will refuse a debug directory that lies within the file headers (rather than within a defined section), and will fail to load the binary.

Place the debug directory at the start of the .rodata section for iPXE, and at the start of the .data section for wimboot.

The debug directory irritatingly includes an RVA and a file offset, neither of which can be calculated by the linker. Update these fields at the time of running elf2efi, after having calculated the file offsets for each section.

Debugged-by: Kansu Dincer kdincer@microsoft.com
Debugged-by: Christian Nilsson nikize@gmail.com

Fixes: #1847

Some strict PE parsers will refuse a debug directory that lies within
the file headers (rather than within a defined section), and will fail
to load the binary.

Place the debug directory at the start of the .rodata section for
iPXE, and at the start of the .data section for wimboot.

The debug directory irritatingly includes an RVA and a file offset,
neither of which can be calculated by the linker.  Update these fields
at the time of running elf2efi, after having calculated the file
offsets for each section.

Debugged-by: Kansu Dincer <kdincer@microsoft.com>
Debugged-by: Christian Nilsson <nikize@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>

This branch was successfully deployed

2 active deployments
publish — 0e98032a Deployed Sep 29, 2026 by mcb30 via Publish #2930
syncforks — 0e98032a Deployed Sep 29, 2026 by mcb30 via Sync (mcb30, ipxe) #141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iPXE and wimboot on Patina Firmware gives 'Cannot map ImageDebugDirectory'

1 participant