[llvm] [lld] [LLD] [COFF] Add tests to observe details about LTO and __imp_ prefixes. NFC. (PR #72764)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 21 00:50:13 PST 2023


mstorsjo wrote:

> This lacks a test for an `__imp_` alias to a data symbol (LLVM global variable), right?

Sure, I updated it with such a case, will merge this and #71376 once the CI has passed.

> It seems useful to add one, even if the behavior is the same as a function symbol, as at the object file format level there is some nuance.

Actually, on the object file format level, they are identical. The main gotcha where they differ, is if you reference a symbol without the dllimport attribute, but it turns out to be imported from a DLL. For a function, this just causes the function call to go via a thunk, while for data symbols, it's a linker error. (In MinGW contexts, it can get fixed with the autoimport/runtime pseudo relocation mechanism though.)

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


More information about the llvm-commits mailing list