llvm-project
ac31d64a - [LLD][COFF] Avoid resolving symbols with -alternatename if the target is undefined (#149496)

Commit
176 days ago
[LLD][COFF] Avoid resolving symbols with -alternatename if the target is undefined (#149496) This change fixes an issue with the use of `-alternatename` in the MSVC CRT on ARM64EC, where both mangled and demangled symbol names are specified. Without this patch, the demangled name could be resolved to an anti-dependency alias of the target. Since chaining anti-dependency aliases is not allowed, this results in an undefined symbol. The root cause isn't specific to ARM64EC, it can affect other targets as well, even when anti-dependency aliases aren't involved. The accompanying test case demonstrates a scenario where the symbol could be resolved from an archive. However, because the archive member is pulled in after the first pass of alternate name resolution, and archive members don't override weak aliases, eager resolution would incorrectly skip it.
Author
Parents
Loading