[lld] [llvm] [LLD] [COFF] Fix linking import libraries with -wholearchive: (PR #122806)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 02:26:23 PST 2025


cjacek wrote:

> I guess this is what you hit and refer to?

Yes, a few variations of that combined with your findings about requiring it in a separate object file defining the section explains the behavior. Thanks! One variant I encountered with an import library happened because I used an overly simplified test case, passing only an import library with `-dll -noentry` and no accompanying object file. As a result, no actual imports were made, and `.idata$4` wasn’t created through other means. This led to the error:
```
wholearchive-implib.s.tmp.lib : fatal error LNK1127: library is corrupt
```
I don’t think this is an issue in practice, though, since there would typically be actual imports present.

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


More information about the llvm-commits mailing list