diff options
Diffstat (limited to 'lld/lib')
-rw-r--r-- | lld/lib/Driver/WinLinkDriver.cpp | 8 | ||||
-rw-r--r-- | lld/lib/Driver/WinLinkOptions.td | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lld/lib/Driver/WinLinkDriver.cpp b/lld/lib/Driver/WinLinkDriver.cpp index 7e9a55cfcbd..7864f034e96 100644 --- a/lld/lib/Driver/WinLinkDriver.cpp +++ b/lld/lib/Driver/WinLinkDriver.cpp @@ -891,12 +891,18 @@ WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ctx, new PECOFFFileNode(ctx, path))); // Use the default entry name if /entry option is not given. - if (ctx.entrySymbolName().empty()) + if (ctx.entrySymbolName().empty() && !parsedArgs->getLastArg(OPT_noentry)) ctx.setEntrySymbolName(getDefaultEntrySymbolName(ctx)); StringRef entry = ctx.entrySymbolName(); if (!entry.empty()) ctx.addInitialUndefinedSymbol(entry); + // Specify /noentry without /dll is an error. + if (parsedArgs->getLastArg(OPT_noentry) && !parsedArgs->getLastArg(OPT_dll)) { + diagnostics << "/noentry must be specified with /dll\n"; + return false; + } + // Specifying both /opt:ref and /opt:noref is an error. if (parsedArgs->getLastArg(OPT_ref) && parsedArgs->getLastArg(OPT_ref_no)) { diagnostics << "/opt:ref must not be specified with /opt:noref\n"; diff --git a/lld/lib/Driver/WinLinkOptions.td b/lld/lib/Driver/WinLinkOptions.td index 6404680bd62..8e9f5b21d2c 100644 --- a/lld/lib/Driver/WinLinkOptions.td +++ b/lld/lib/Driver/WinLinkOptions.td @@ -50,6 +50,8 @@ def incl : Joined<["/", "-"], "include:">, def incl_c : Separate<["/", "-"], "include">, Alias<incl>; def nodefaultlib_all : F<"nodefaultlib">; +def noentry : F<"noentry">; +def dll : F<"dll">; def debug : F<"debug">; def swaprun_cd : F<"swaprun:cd">; |