在 2025-8-8 05:43, Pali Rohár 写道:
Not exactly. About patch #2 you are right, symbols belongs to lz32.dll. But about patch #3, those symbols belongs to kernel32.dll. Just MS toolchain has some of kernel32.dll symbols in kernel32.lib import lib and some in thunk32.lib import lib and some has in th32.lib.
That's right, MS thunk32.lib says these functions are exported from kernel32.dll. But that's not the case anymore; these functions are no longer exported any system DLL, at least since XP. I can only find them from kernel32.dll on Windows 98. So I think I would say that these symbols do not belong anywhere.
It is quite strange in ms that one dll has 3 import libs. mingw-w64 does not have th32.lib import library (which contains e.g. CreateToolhelp32Snapshot) and that symbol is in libkernel32.a import lib. So I thought that in mingw is direction that one DLL has one import library. Hence I sent that change #3 which enables kernel32.dll symbols of thunk32.lib via kernel32.def file. That was my motivation, I'm writing it just for explanation.
It's because GNU binutils produces import libraries in the traditional, long format, while MSVC and LLVM produce import libraries in the modern, short format [1].
In the short format, each import member has its own DLL name, so it's possible to provide symbols from different DLLs in a single import library. That's how OneCore.lib works.
[1] https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#import-library-format -- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public