Skip to content

Fix ARM64 alignment for object type exports#305

Merged
kumarvin123 merged 1 commit intomainfrom
fix/arm64-object-type-alignment
May 7, 2026
Merged

Fix ARM64 alignment for object type exports#305
kumarvin123 merged 1 commit intomainfrom
fix/arm64-object-type-alignment

Conversation

@Alan-Jowett
Copy link
Copy Markdown
Member

Mark ExEventObjectType and IoFileObjectType as DATA exports in Source.def. Without DATA, the import library generates function-style thunks that are only 4-byte aligned on ARM64, but the ARM64 LDR instruction for 8-byte loads requires 8-byte alignment, causing LNK2048 relocation errors.

Consumers that reference these symbols without __declspec(dllimport) (e.g. via WDK headers) need /ALTERNATENAME linker flags to resolve the direct references against the _imp import symbols.

Mark ExEventObjectType and IoFileObjectType as DATA exports in Source.def. Without DATA, the import library generates function-style thunks that are only 4-byte aligned on ARM64, but the ARM64 LDR instruction for 8-byte loads requires 8-byte alignment, causing LNK2048 relocation errors.

Consumers that reference these symbols without __declspec(dllimport) (e.g. via WDK headers) need /ALTERNATENAME linker flags to resolve the direct references against the __imp_ import symbols.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Alan-Jowett Alan-Jowett requested a review from mtfriesen as a code owner May 6, 2026 22:36
@kumarvin123 kumarvin123 merged commit 3559aa9 into main May 7, 2026
12 checks passed
@kumarvin123 kumarvin123 deleted the fix/arm64-object-type-alignment branch May 7, 2026 01:09
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.

2 participants