forked from OSchip/llvm-project
[PECOFF] Parse /dll command line option.
llvm-svn: 197123
This commit is contained in:
parent
4cf5a16117
commit
d3199fdd2e
|
@ -250,7 +250,7 @@ protected:
|
|||
|
||||
private:
|
||||
// The start address for the program. The default value for the executable is
|
||||
// 0x400000, but can be altered using -base command line option.
|
||||
// 0x400000, but can be altered using /base command line option.
|
||||
uint64_t _baseAddress;
|
||||
|
||||
uint64_t _stackReserve;
|
||||
|
|
|
@ -679,6 +679,14 @@ WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ctx,
|
|||
ctx.setBaseAddress(addr);
|
||||
break;
|
||||
|
||||
case OPT_dll:
|
||||
// Parse /dll command line option
|
||||
ctx.setImageType(PECOFFLinkingContext::IMAGE_DLL);
|
||||
// Default base address of a DLL is 0x10000000.
|
||||
if (!parsedArgs->getLastArg(OPT_base))
|
||||
ctx.setBaseAddress(0x10000000);
|
||||
break;
|
||||
|
||||
case OPT_stack: {
|
||||
// Parse /stack command line option
|
||||
uint64_t reserve;
|
||||
|
|
|
@ -45,6 +45,7 @@ TEST_F(WinLinkParserTest, Basic) {
|
|||
EXPECT_TRUE(_context.getInputSearchPaths().empty());
|
||||
|
||||
// Unspecified flags will have default values.
|
||||
EXPECT_EQ(PECOFFLinkingContext::IMAGE_EXE, _context.getImageType());
|
||||
EXPECT_EQ(6, _context.getMinOSVersion().majorVersion);
|
||||
EXPECT_EQ(0, _context.getMinOSVersion().minorVersion);
|
||||
EXPECT_EQ(0x400000U, _context.getBaseAddress());
|
||||
|
@ -377,6 +378,8 @@ TEST_F(WinLinkParserTest, DisallowLib) {
|
|||
|
||||
TEST_F(WinLinkParserTest, NoEntry) {
|
||||
EXPECT_TRUE(parse("link.exe", "/noentry", "/dll", "a.obj", nullptr));
|
||||
EXPECT_EQ(PECOFFLinkingContext::IMAGE_DLL, _context.getImageType());
|
||||
EXPECT_EQ(0x10000000U, _context.getBaseAddress());
|
||||
EXPECT_EQ("", _context.entrySymbolName());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue