[lld] r198072 - [PECOFF] Change the DLL entry symbol.

Reid Kleckner rnk at google.com
Thu Dec 26 23:23:16 PST 2013


This is the stdcall mangling, which lots of win32 APIs use.  The function
pops the number of bytes it receives as arguments, and that's 12 in this
case.  There's an implementation in llvm/lib/Target/Mangler.cpp.


On Thu, Dec 26, 2013 at 11:14 PM, Rui Ueyama <ruiu at google.com> wrote:

> Author: ruiu
> Date: Fri Dec 27 01:14:34 2013
> New Revision: 198072
>
> URL: http://llvm.org/viewvc/llvm-project?rev=198072&view=rev
> Log:
> [PECOFF] Change the DLL entry symbol.
>
> I'm not 100% sure but it looks like DLL entry symbol (DLL initializer
> function
> name) should be _DllMainCRTStartup at 12. The reason why I'm not very sure is
> because I have no idea what "@12" suffix is, but without it the symbol
> won't
> be resolved...
>
> Modified:
>     lld/trunk/lib/Driver/WinLinkDriver.cpp
>
> Modified: lld/trunk/lib/Driver/WinLinkDriver.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=198072&r1=198071&r2=198072&view=diff
>
> ==============================================================================
> --- lld/trunk/lib/Driver/WinLinkDriver.cpp (original)
> +++ lld/trunk/lib/Driver/WinLinkDriver.cpp Fri Dec 27 01:14:34 2013
> @@ -572,7 +572,7 @@ void processLibEnv(PECOFFLinkingContext
>  // subsystem. These default names are MS CRT compliant.
>  StringRef getDefaultEntrySymbolName(PECOFFLinkingContext &context) {
>    if (context.getImageType() ==
> PECOFFLinkingContext::ImageType::IMAGE_DLL)
> -    return "_DllMainCRTStartup";
> +    return "_DllMainCRTStartup at 12";
>    llvm::COFF::WindowsSubsystem subsystem = context.getSubsystem();
>    if (subsystem ==
> llvm::COFF::WindowsSubsystem::IMAGE_SUBSYSTEM_WINDOWS_GUI)
>      return "WinMainCRTStartup";
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131226/a8aeb9ad/attachment.html>


More information about the llvm-commits mailing list