[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:24:31 PDT 2017
mstorsjo added inline comments.
================
Comment at: MinGW/Driver.cpp:131
+ if (auto *A = Args.getLastArg(OPT_entry)) {
+ if (Args.getLastArgValue(OPT_m) == "i386pe" && A->getValue()[0] == '_')
+ Add("-entry:" + StringRef(A->getValue()).substr(1));
----------------
ruiu wrote:
> A->getValue() could be an empty string if you specify `-e ''`, so you want to guard against it. I'd do
>
> if (auto *A = Args.getLastArg(OPT_entry)) {
> StringRef S = A->getValue();
> if (Args.getLastArgValue(OPT_m) == "i386pe" && S.startswith('_'))
Thanks, will change and commit in that form.
https://reviews.llvm.org/D37710
More information about the llvm-commits
mailing list