[all-commits] [llvm/llvm-project] 1c05c6: [LLD][COFF] Swap the meaning of symtab and hybridS...
Jacek Caban via All-commits
all-commits at lists.llvm.org
Fri Apr 11 06:53:48 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1c05c6183da836d148eb3f558e8f8e0194f39eed
https://github.com/llvm/llvm-project/commit/1c05c6183da836d148eb3f558e8f8e0194f39eed
Author: Jacek Caban <jacek at codeweavers.com>
Date: 2025-04-11 (Fri, 11 Apr 2025)
Changed paths:
M lld/COFF/COFFLinkerContext.h
M lld/COFF/Chunks.cpp
M lld/COFF/Driver.cpp
M lld/COFF/InputFiles.cpp
M lld/COFF/Writer.cpp
A lld/test/COFF/arm64x-map.s
Log Message:
-----------
[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.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list