COFF: /HighEntropyVA is on by default only on 64-bit.

llvm-svn: 243374
This commit is contained in:
Rui Ueyama 2015-07-28 03:15:57 +00:00
parent 4d54534627
commit d68e211be5
3 changed files with 6 additions and 5 deletions

View File

@ -113,12 +113,12 @@ struct Configuration {
uint32_t MajorOSVersion = 6;
uint32_t MinorOSVersion = 0;
bool DynamicBase = true;
bool HighEntropyVA = true;
bool AllowBind = true;
bool NxCompat = true;
bool AllowIsolation = true;
bool TerminalServerAware = true;
bool LargeAddressAware = false;
bool HighEntropyVA = false;
};
extern Configuration *Config;

View File

@ -464,8 +464,6 @@ bool LinkerDriver::link(llvm::ArrayRef<const char *> ArgsArr) {
Config->AllowIsolation = false;
if (Args.hasArg(OPT_dynamicbase_no))
Config->DynamicBase = false;
if (Args.hasArg(OPT_highentropyva_no))
Config->HighEntropyVA = false;
if (Args.hasArg(OPT_nxcompat_no))
Config->NxCompat = false;
if (Args.hasArg(OPT_tsaware_no))
@ -559,6 +557,10 @@ bool LinkerDriver::link(llvm::ArrayRef<const char *> ArgsArr) {
if (Config->is64() || Args.hasArg(OPT_largeaddressaware))
Config->LargeAddressAware = true;
// Handle /highentropyva
if (Config->is64() && !Args.hasArg(OPT_highentropyva_no))
Config->HighEntropyVA = true;
// Handle /entry and /dll
if (auto *Arg = Args.getLastArg(OPT_entry)) {
Config->Entry = addUndefined(mangle(Arg->getValue()));

View File

@ -41,9 +41,8 @@ HEADER-NEXT: MinorSubsystemVersion: 0
HEADER-NEXT: SizeOfImage: 20480
HEADER-NEXT: SizeOfHeaders: 4096
HEADER-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3)
HEADER-NEXT: Characteristics [ (0x8160)
HEADER-NEXT: Characteristics [ (0x8140)
HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40)
HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA (0x20)
HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100)
HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000)
HEADER-NEXT: ]