}
}
- // Specify /noentry without /dll is an error.
- if (!ctx.hasEntry() && !parsedArgs->getLastArg(OPT_dll)) {
- diag << "/noentry must be specified with /dll\n";
- return false;
- }
-
// If dead-stripping is enabled, we need to add the entry symbol and
// symbols given by /include to the dead strip root set, so that it
// won't be removed from the output.
return false;
}
+ // Specifing /noentry without /dll is an error.
+ if (!hasEntry() && !isDll()) {
+ diagnostics << "/noentry must be specified with /dll\n";
+ return false;
+ }
+
// Check for duplicate export ordinals.
std::set<int> exports;
for (const PECOFFLinkingContext::ExportDesc &desc : getDllExports()) {
# RUN: llvm-readobj -file-headers %t.exe | FileCheck %s
CHECK: AddressOfEntryPoint: 0x0
+
+# RUN: not lld -flavor link /out:%t.exe /noentry -- %t.obj >& %t.log
+# RUN: FileCheck --check-prefix=ERROR %s < %t.log
+
+ERROR: /noentry must be specified with /dll