diff options
author | Jacek Caban <jacek@codeweavers.com> | 2025-04-11 15:53:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-11 15:53:25 +0200 |
commit | 1c05c6183da836d148eb3f558e8f8e0194f39eed (patch) | |
tree | d745667404d8bef757a0e445ec8938933902bef1 /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | |
parent | 0f615fbb0a964082a6601a2838c9788bd29a97ba (diff) | |
download | llvm-1c05c6183da836d148eb3f558e8f8e0194f39eed.zip llvm-1c05c6183da836d148eb3f558e8f8e0194f39eed.tar.gz llvm-1c05c6183da836d148eb3f558e8f8e0194f39eed.tar.bz2 |
[LLD][COFF] Swap the meaning of symtab and hybridSymtab in hybrid images (#135093)
Originally, the intent behind symtab was to represent the symbol table
seen in the PE header (without applying ARM64X relocations). However, in
most cases outside of `writeHeader()`, the code references either both
symbol tables or only the EC one, for example, `mainSymtab` in
`linkerMain()` maps to `hybridSymtab` on ARM64X.
MSVC's link.exe allows pure ARM64EC images to include native ARM64
files. This patch prepares LLD to support the same, which will require
`hybridSymtab` to be available even for ARM64EC. At that point,
`writeHeader()` will need to use the EC symbol table, and the original
reasoning for keeping it in `hybridSymtab` no longer applies.
Given this, it seems cleaner to treat the EC symbol table as the “main”
one, assigning it to `symtab`, and use `hybridSymtab` for the native
symbol table instead. Since `writeHeader()` will need to be conditional
anyway, this change simplifies the rest of the code by allowing other
parts to consistently treat `ctx.symtab` as the main symbol table.
As a further simplification, this also allows us to eliminate `symtabEC`
and use `symtab` directly; I’ll submit that as a separate PR.
The map file now uses the EC symbol table for printed entry points and
exports, matching MSVC behavior.
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
0 files changed, 0 insertions, 0 deletions