Skip to content

Make COFF section padding optional.#1605

Merged
grynspan merged 2 commits intomainfrom
jgrynspan/coff-padding-optional
Mar 3, 2026
Merged

Make COFF section padding optional.#1605
grynspan merged 2 commits intomainfrom
jgrynspan/coff-padding-optional

Conversation

@grynspan
Copy link
Contributor

@grynspan grynspan commented Mar 3, 2026

This PR adjusts our logic for test content section discovery on Windows so that the presence of leading and trailing zeroed words is optional.

After the next Swift release (6.4), I'll remove the relevant logic in SwiftRT-COFF.cpp that emits this padding for the test section in particular. Then eventually we can remove this padding check outright.

See also swiftlang/swift#87650.

A valid type metadata record or test content record won't start with nor end with a fully zeroed DWORD/QWORD, so I'm not worried about accidentally misreading those records.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

This PR adjusts our logic for test content section discovery on Windows so that
the presence of leading and trailing zeroed words is optional.

After the next Swift release (6.4), I'll remove the relevant logic in
[SwiftRT-COFF.cpp](https://github.com/swiftlang/swift/blob/main/stdlib/public/runtime/SwiftRT-COFF.cpp)
that emits this padding for the test section in particular. Then eventually we
can remove this padding check outright.

A valid type metadata record or test content record won't start with nor end
with a fully zeroed `DWORD`/`QWORD`, so I'm not worried about accidentally
misreading those records.
@grynspan grynspan added this to the Swift 6.4.0 (main) milestone Mar 3, 2026
@grynspan grynspan self-assigned this Mar 3, 2026
@grynspan grynspan added windows 🪟 Windows support discovery 🔎 test content discovery labels Mar 3, 2026
@grynspan grynspan merged commit f8406de into main Mar 3, 2026
53 of 54 checks passed
@grynspan grynspan deleted the jgrynspan/coff-padding-optional branch March 3, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discovery 🔎 test content discovery windows 🪟 Windows support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants