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

Saleem Abdulrasool compnerd at compnerd.org
Thu Dec 26 23:53:26 PST 2013


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...
>

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.


> 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
>



-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131226/f5461620/attachment.html>


More information about the llvm-commits mailing list