[PATCH] D146534: [llvm-nm] Print EC symbol map.

Jacek Caban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 10:18:41 PDT 2023


jacek added a comment.

In D146534#4212353 <https://reviews.llvm.org/D146534#4212353>, @jhenderson wrote:

> What are "ECSymbols"?

Those are "emulation compatible" symbols used for ARM64EC support:
https://learn.microsoft.com/en-us/cpp/build/arm64ec-windows-abi-conventions?view=msvc-170
ARM64EC allows linking a special ARM64 object files together with x86_64 object files. It's also possible to build ARM64X binaries containing both pure ARM64 and ARM64EC code, in which case both have separated namespaces and, depending on process loading the module, only one variant is used in runtime.

For static libraries, it's allowed to have both ARM64 and ARM64EC in a single library. Since they need separated namespaces, they can't share symbol map. ARM64EC uses <ECSYMBOLS> instead of the usual map.

> Is there a spec I can read for them, so that I can review this change?

No, there is no scpec that I'm aware of. I figured the format by inspecting libraries produced by MSVC lib.exe. I will add more comments to the code, but the format is very similar to usual COFF symbol map:

- 32-bit LE number of symbols
- followed by an array of 16-bit member index for each symbol. This is an index in offset table from the regular COFF symbol table (it there is no separated offset table)
- followed by null-terminated strings names for each symbol in the same order as indexes above

See also writeECSymbols from https://reviews.llvm.org/D143541


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146534/new/

https://reviews.llvm.org/D146534



More information about the llvm-commits mailing list