Conversation
There was a problem hiding this comment.
Pull request overview
Adds ARM64EC support across MSVC and GNU import library generation, including archive-format updates needed for ARM64EC COFF archives.
Changes:
- Introduces
MachineType::ARM64ECand maps it appropriately in MSVC/GNU generation paths. - MSVC: adds ARM64EC name mangling +
IMPORT_NAME_EXPORTAS, and splits symbols between regular and EC symbol tables. - Archive writer: adds
/<ECSYMBOLS>/support and writes a second linker member when generating EC archives; updatesobjectdependency to 0.39.1.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/lib.rs |
Adds ARM64EC machine type and a native-machine mapping used by MSVC descriptor objects. |
src/msvc.rs |
Implements ARM64EC import name mangling, EXPORTAS handling, descriptor-vs-EC symbol table splitting, and adds unit tests for mangling logic. |
src/gnu.rs |
Maps ARM64EC to AArch64 and reuses ARM64 stubs/relocations; minor error-construction refactors. |
src/ar/write.rs |
Adds a second linker member for EC archives and emits the /<ECSYMBOLS>/ member; supports dual symbol tables. |
src/ar/mod.rs |
Defines EC_SYMBOL_TABLE_ID constant for the new member. |
src/def/parser.rs |
Minor refactor: derive-based Default for TokenKind and small control-flow cleanup. |
tests/test_import_lib.rs |
Adds ARM64EC tests for MSVC and GNU flavors (light structural assertion for MSVC). |
Cargo.toml |
Bumps object crate to 0.39.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Implements generation of ARM64EC (Emulation Compatible) Windows import libraries, verified byte-identical to `llvm-dlltool` output. Changes: - Add `ARM64EC` variant to `MachineType` (`IMAGE_FILE_MACHINE_ARM64EC` = 0xA641) - MSVC flavor: use native ARM64 for descriptor objects, ARM64EC for short imports; mangle code import names with `#` prefix (or `$$h` insertion for C++ names) and emit them via `IMPORT_NAME_EXPORTAS` - Archive writer: write second linker member (LE, name-sorted with `u16` member indices) and `/<ECSYMBOLS>/` member required for COFF/EC archives - Split symbols across regular and EC tables: descriptors go in regular (duplicated to EC), exports go in EC only - GNU flavor: map ARM64EC to Aarch64 with ARM64 jmp stubs/relocations - Update `object` crate to 0.39.1 (replace deprecated `U16Bytes`/`U32Bytes` aliases with `U16`/`U32`) - Add lightweight MSVC mangled-name parser (~130 lines) to find the `$$h` insertion point without depending on a full demangler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements generation of ARM64EC (Emulation Compatible) Windows import libraries, verified byte-identical to
llvm-dlltooloutput.Changes:
ARM64ECvariant toMachineType(IMAGE_FILE_MACHINE_ARM64EC= 0xA641)#prefix (or$$hinsertion for C++ names) and emit them viaIMPORT_NAME_EXPORTASu16member indices) and/<ECSYMBOLS>/member required for COFF/EC archivesobjectcrate to 0.39.1 (replace deprecatedU16Bytes/U32Bytesaliases withU16/U32)$$hinsertion point without depending on a full demangler