[lld] [LLD][COFF] Introduce hybrid symbol table for EC input files on ARM64X (PR #119294)
Jacek Caban via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 13 09:52:57 PST 2024
cjacek wrote:
Thanks for reviews!
> Can you verbally explain what the state is after this commit? We essentially do symbol resolution separately within the both namespaces - and when writing the final image, we just serialize all included Chunks into the output image?
Yes, with this commit, we now have two distinct namespaces, each with independent name resolution. The writer still operates on file and/or chunk collections globally rather than being tied to a specific namespace. Its existing functionality remains unchanged, as it already handles different chunk machine types, including sorting, splitting, and aligning code chunks. Those parts are largely complete.
Most of the writer and driver code still uses `ctx.symtab` and ignores the hybrid symbol table. While this is correct in some cases (e.g., the PE header writer only needs to operate on the native namespace), other parts will require adjustments as outlined in the first comment.
> What's the reason why we now link two separate copies of the load config in the testcases - what difference does that make? (If we wouldn't be linking two load configs but run the old testcases as they were, what would the results be?)
PE header writer uses the native namespace to look up the load config referenced by the PE data directory. Without adding the second load config, executables created by the tests would lack a load config entirely. The hybrid load config is only accessible after applying ARM64X relocations, but those relocations are exposed to the loader via the native load config itself. Without a native load config, they wouldn't be visible (load config data directory ARM64X relocations aren't part of this patch; see [this commit](https://github.com/cjacek/llvm-project/commit/e7f8cacdcfbcced24f1985ce132aadd2cbe9cf2f) for how I plan to implement that part).
For this commit, replacing the EC load config with the native one might work but wouldn't represent real progress. Ultimately, we should pass both load configs. The current hack, which allowed for splitting commits, involves providing CHPE metadata in the native load config. This metadata should instead be present only in the EC version, which we then copy over by the linker to the native version. See [this commit ](https://github.com/cjacek/llvm-project/commit/990b779ec6897fdd51dd5b1a13df085b390ccf2d) for an implementation that aligns tests with the intended use of load configs on ARM64X.
https://github.com/llvm/llvm-project/pull/119294
More information about the llvm-commits
mailing list