<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Dec 26, 2013 at 11:14 PM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Author: ruiu<br>
Date: Fri Dec 27 01:14:34 2013<br>
New Revision: 198072<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=198072&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=198072&view=rev</a><br>
Log:<br>
[PECOFF] Change the DLL entry symbol.<br>
<br>
I'm not 100% sure but it looks like DLL entry symbol (DLL initializer function<br>
name) should be _DllMainCRTStartup@12. The reason why I'm not very sure is<br>
because I have no idea what "@12" suffix is, but without it the symbol won't<br>
be resolved...<br></blockquote><div><br></div><div>As Reid mentioned, the @12 suffix is the result of the stdcall rather than cdecl.  This needs to be wrapped within an architecture specific case, since not all architectures (e.g. x86_64) support use of the stdcall CC.  Check if the target is x86 and switch between the two versions depending.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Modified:<br>
    lld/trunk/lib/Driver/WinLinkDriver.cpp<br>
<br>
Modified: lld/trunk/lib/Driver/WinLinkDriver.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=198072&r1=198071&r2=198072&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=198072&r1=198071&r2=198072&view=diff</a><br>


==============================================================================<br>
--- lld/trunk/lib/Driver/WinLinkDriver.cpp (original)<br>
+++ lld/trunk/lib/Driver/WinLinkDriver.cpp Fri Dec 27 01:14:34 2013<br>
@@ -572,7 +572,7 @@ void processLibEnv(PECOFFLinkingContext<br>
 // subsystem. These default names are MS CRT compliant.<br>
 StringRef getDefaultEntrySymbolName(PECOFFLinkingContext &context) {<br>
   if (context.getImageType() == PECOFFLinkingContext::ImageType::IMAGE_DLL)<br>
-    return "_DllMainCRTStartup";<br>
+    return "_DllMainCRTStartup@12";<br>
   llvm::COFF::WindowsSubsystem subsystem = context.getSubsystem();<br>
   if (subsystem == llvm::COFF::WindowsSubsystem::IMAGE_SUBSYSTEM_WINDOWS_GUI)<br>
     return "WinMainCRTStartup";<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org
</div></div>