[llvm] [ORC][COFF] Preserve import symbol types in DLL stubs (PR #217445)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 06:15:25 PDT 2026


Sp0tless wrote:

Thanks @lhames. I reworked this locally as a COFF-specific `StaticLibraryDefinitionGenerator`. It delegates ordinary object members to the existing generator and handles short-import members separately, preserving their DLL name, local/export names, and import type.

While testing it, I found an interaction with the default IAT synthesis from #203906. That pass consumes `__imp_local` before external lookup and replaces its target with `local`. This works for same-name imports, but loses import library `EXPORTAS` metadata: code imports produce an extra thunk indirection, while data imports fail with `Symbols not found: [ local ]`.

I have focused reproducers for both cases, but have not pushed the rewrite yet. Should the COFF static-library generator be authoritative when matching short-import metadata exists, with #203906 used only as a fallback? If so, where should that ordering be implemented?

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


More information about the llvm-commits mailing list