summaryrefslogtreecommitdiffstats
path: root/lld/lib/Driver/WinLinkDriver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/lib/Driver/WinLinkDriver.cpp')
-rw-r--r--lld/lib/Driver/WinLinkDriver.cpp8
1 files changed, 7 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";
OpenPOWER on IntegriCloud