class PECOFFLinkingContext : public LinkingContext {
public:
PECOFFLinkingContext()
- : _mutex(), _allocMutex(), _baseAddress(invalidBaseAddress),
+ : _mutex(), _allocMutex(), _hasEntry(true), _baseAddress(invalidBaseAddress),
_stackReserve(1024 * 1024), _stackCommit(4096),
_heapReserve(1024 * 1024), _heapCommit(4096), _noDefaultLibAll(false),
_sectionDefaultAlignment(4096),
LinkingContext::setEntrySymbolName(decorateSymbol(name));
}
+ void setHasEntry(bool val) { _hasEntry = val; }
+ bool hasEntry() const { return _hasEntry; }
+
void setBaseAddress(uint64_t addr) { _baseAddress = addr; }
uint64_t getBaseAddress() const;
std::recursive_mutex _mutex;
mutable std::mutex _allocMutex;
+ // False if /noentry option is given.
+ bool _hasEntry;
+
// The start address for the program. The default value for the executable is
// 0x400000, but can be altered using /base command line option.
uint64_t _baseAddress;
ctx.addInitialUndefinedSymbol(ctx.allocate(inputArg->getValue()));
break;
+ case OPT_noentry:
+ ctx.setHasEntry(false);
+ break;
+
case OPT_nodefaultlib_all:
ctx.setNoDefaultLibAll(true);
break;
ctx.addInitialUndefinedSymbol(entry);
// Specify /noentry without /dll is an error.
- if (parsedArgs->getLastArg(OPT_noentry) && !parsedArgs->getLastArg(OPT_dll)) {
+ if (!ctx.hasEntry() && !parsedArgs->getLastArg(OPT_dll)) {
diag << "/noentry must be specified with /dll\n";
return false;
}