[PATCH] D37710: [LLD] [MinGW] Pass the undecorated entry point name to the COFF linker

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 00:59:53 PDT 2017


mstorsjo added a comment.

In https://reviews.llvm.org/D37710#867043, @ruiu wrote:

> Can't you link your program without line 131-133?


And to answer this part of the question... Normally the clang frontend doesn't pass the `--entry` option at all, so for a normal executable, things work as they are. However, when linking DLLs, the clang frontend passes this option, and things currently fail (for i386 DLLs).

To add to the confusion, the DLL entry point in MSVC is by default named `_DllMainCRTStartup` (which after i386 mangling ends up as `__DllMainCRTStartup at 12`. In MinGW (and as in the defaults in the clang MinGW frontend), the DLL entry point is named `DllMainCRTStartup` which on i386 ends up as `_DllMainCRTStartup at 12`.


https://reviews.llvm.org/D37710





More information about the llvm-commits mailing list