[lld] [LLD][MinGW] Fix implicit DLL entry point (PR #171680)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 17 03:22:39 PST 2025


https://github.com/mstorsjo commented:

Looks good in general, just one small nit on the code, and two on the commit message (PR description).

For the commit message, prefixing it with `[LLD] [COFF]` could be more correct, since this is changing the code for the COFF linker part, even though it is specific to mingw mode use of it.

Also, it could be good to clarify, that when linking is driven from Clang (or GCC), the compiler driver passes an explicit entry point, so this shouldn't change anything for those cases.

For reference, so we know the implicit default is the right one, we can check https://github.com/llvm/llvm-project/blob/llvmorg-21.1.8/clang/lib/Driver/ToolChains/MinGW.cpp#L176-L180 which passes `-e DllMainCRTStartup` or `-e _DllMainCRTStartup at 12`. https://github.com/llvm/llvm-project/blob/llvmorg-21.1.8/lld/MinGW/Driver.cpp#L235-L243 does strip out the leading underscore on i386, which gets put back by the `symtab.mangle(arg->getValue()` a few lines above the call to `DllDefaultEntryPoint`. TL;DR, the code change looks correct.

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


More information about the llvm-commits mailing list