Skip to content

UEFI Target groundwork: runtime: extract Windows PE globals scan helper#5361

Open
sparques wants to merge 1 commit intotinygo-org:devfrom
sparques:pr/runtime-windows-pe-helper
Open

UEFI Target groundwork: runtime: extract Windows PE globals scan helper#5361
sparques wants to merge 1 commit intotinygo-org:devfrom
sparques:pr/runtime-windows-pe-helper

Conversation

@sparques
Copy link
Copy Markdown
Contributor

@sparques sparques commented May 1, 2026

I am back with another attempt trying to get UEFI as a target.

Summary

This PR extracts the PE/COFF globals-scanning logic from src/runtime/os_windows.go into a separate helper file, src/runtime/os_windows_pe.go.

The extracted code includes:

  • PE header structs
  • section header structs
  • module handle storage
  • the helper that scans writable PE sections for GC roots

Why

The Windows runtime currently embeds PE parsing details directly inside findGlobals. Pulling that logic into a dedicated helper makes the runtime code easier to follow and isolates the PE-specific implementation detail in one place. For supporting UEFI, the PE stuff is needed isolated from the rest of os_windows.go.

Behavior

This is intended to be a mechanical refactor only. There should be no functional change to Windows behavior.

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.

1 participant