[lld] [lld] Implement getOutputCharacteristics for non-section code thunks. (PR #70721)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 09:45:09 PDT 2023


cjacek wrote:

Thanks for review!

> The case of reexporting the thunk of an imported function is kinda contrieved though - I presume that only would happen in a contrieved setup when manually requesting it to be exported? The autoexporter doesn't export them, right?

Yes, autoexporter doesn't export them because it exports only `DefinedRegular` and `DefinedCommon`, so `DefinedImportThunk` is skipped.

It's indeed not a common use case and I made up the test just because I noticed that this code path will change. But it's also not entirely contrieved, I know a few such examples in Wine code base. One of them would be `kernel32.dll`, which forwards most of functions to `kernelbase.dll`, but doesn't use forwarding exports because some applications expect actual entry points. On non-x86 targets Wine exports import thunks instead. (Wine generates `.edata` section itself, so this commit is not relevant to it, but the mechanism is the same).

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


More information about the llvm-commits mailing list