[lld] [LLD][COFF] Create EC alias symbols for entry points and exports (PR #114297)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 13:08:56 PDT 2024


cjacek wrote:

I still have a few more fixes queued, but this is the final feature needed to link ARM64EC msvcrt.lib properly, making the linker genuinely useful.

The underlying issue is that entry points are provided by archives, which only contain the mangled name in the index. Although the object files that implement these symbols include the demangled alias, they aren’t visible until the object file is pulled in. This change creates aliases for entry point and exported function symbols to ensure they can be properly included.

This behavior is mostly compatible with what the MSVC linker does: all tests pass except the one where `-entry:#func` is specified. In that case, MSVC would automatically re-mangle the name and emit an undefined `##func` error. That behavior didn’t seem necessary to replicate here, so I left it handling `-entry` the same way as `-export`.

https://github.com/llvm/llvm-project/pull/114297


More information about the llvm-commits mailing list