[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 12:25:16 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL313066: [MinGW] Pass the undecorated entry point name to the COFF linker (authored by mstorsjo).
Changed prior to commit:
https://reviews.llvm.org/D37710?vs=114683&id=114878#toc
Repository:
rL LLVM
https://reviews.llvm.org/D37710
Files:
lld/trunk/MinGW/Driver.cpp
lld/trunk/test/MinGW/driver.test
Index: lld/trunk/MinGW/Driver.cpp
===================================================================
--- lld/trunk/MinGW/Driver.cpp
+++ lld/trunk/MinGW/Driver.cpp
@@ -121,8 +121,14 @@
Add("lld-link");
- if (auto *A = Args.getLastArg(OPT_entry))
- Add("-entry:" + StringRef(A->getValue()));
+ if (auto *A = Args.getLastArg(OPT_entry)) {
+ StringRef S = A->getValue();
+ if (Args.getLastArgValue(OPT_m) == "i386pe" && S.startswith("_"))
+ Add("-entry:" + S.substr(1));
+ else
+ Add("-entry:" + S);
+ }
+
if (auto *A = Args.getLastArg(OPT_subs))
Add("-subsystem:" + StringRef(A->getValue()));
if (auto *A = Args.getLastArg(OPT_out_implib))
Index: lld/trunk/test/MinGW/driver.test
===================================================================
--- lld/trunk/test/MinGW/driver.test
+++ lld/trunk/test/MinGW/driver.test
@@ -44,3 +44,6 @@
RUN: ld.lld -### foo.o -m i386pep --verbose | FileCheck -check-prefix=VERBOSE %s
VERBOSE: -verbose
+
+RUN: ld.lld -### -shared -m i386pe -e _DllMainCRTStartup at 12 foo.o | FileCheck -check-prefix I386-ENTRY %s
+I386-ENTRY: -entry:DllMainCRTStartup at 12
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37710.114878.patch
Type: text/x-patch
Size: 1134 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170912/c01d5bb6/attachment.bin>
More information about the llvm-commits
mailing list