Revert r303378: Set IMAGE_DLL_CHARACTERISTICS_NO_BIND.
r303378 was submitted because r303374 (Merge IAT and ILT) made lld's output incompatible with the Binding feature. Now that r303374 was reverted, we do not need to keep this change. Pointed out by pcc. llvm-svn: 313414
This commit is contained in:
parent
b5abcc558d
commit
eef6b2a5c9
|
@ -167,6 +167,7 @@ struct Configuration {
|
|||
uint32_t MajorOSVersion = 6;
|
||||
uint32_t MinorOSVersion = 0;
|
||||
bool DynamicBase = true;
|
||||
bool AllowBind = true;
|
||||
bool NxCompat = true;
|
||||
bool AllowIsolation = true;
|
||||
bool TerminalServerAware = true;
|
||||
|
|
|
@ -962,6 +962,8 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
|
|||
}
|
||||
|
||||
// Handle miscellaneous boolean flags.
|
||||
if (Args.hasArg(OPT_allowbind_no))
|
||||
Config->AllowBind = false;
|
||||
if (Args.hasArg(OPT_allowisolation_no))
|
||||
Config->AllowIsolation = false;
|
||||
if (Args.hasArg(OPT_dynamicbase_no))
|
||||
|
|
|
@ -683,19 +683,14 @@ template <typename PEHeaderTy> void Writer::writeHeader() {
|
|||
PE->SizeOfStackCommit = Config->StackCommit;
|
||||
PE->SizeOfHeapReserve = Config->HeapReserve;
|
||||
PE->SizeOfHeapCommit = Config->HeapCommit;
|
||||
|
||||
// Import Descriptor Tables and Import Address Tables are merged
|
||||
// in our output. That's not compatible with the Binding feature
|
||||
// that is sort of prelinking. Setting this flag to make it clear
|
||||
// that our outputs are not for the Binding.
|
||||
PE->DLLCharacteristics = IMAGE_DLL_CHARACTERISTICS_NO_BIND;
|
||||
|
||||
if (Config->AppContainer)
|
||||
PE->DLLCharacteristics |= IMAGE_DLL_CHARACTERISTICS_APPCONTAINER;
|
||||
if (Config->DynamicBase)
|
||||
PE->DLLCharacteristics |= IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE;
|
||||
if (Config->HighEntropyVA)
|
||||
PE->DLLCharacteristics |= IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA;
|
||||
if (!Config->AllowBind)
|
||||
PE->DLLCharacteristics |= IMAGE_DLL_CHARACTERISTICS_NO_BIND;
|
||||
if (Config->NxCompat)
|
||||
PE->DLLCharacteristics |= IMAGE_DLL_CHARACTERISTICS_NX_COMPAT;
|
||||
if (!Config->AllowIsolation)
|
||||
|
|
|
@ -42,10 +42,9 @@ HEADER-NEXT: MinorSubsystemVersion: 0
|
|||
HEADER-NEXT: SizeOfImage: 16896
|
||||
HEADER-NEXT: SizeOfHeaders: 512
|
||||
HEADER-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3)
|
||||
HEADER-NEXT: Characteristics [ (0x9940)
|
||||
HEADER-NEXT: Characteristics [ (0x9140)
|
||||
HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_APPCONTAINER (0x1000)
|
||||
HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40)
|
||||
HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_NO_BIND (0x800)
|
||||
HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100)
|
||||
HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000)
|
||||
HEADER-NEXT: ]
|
||||
|
|
|
@ -2,7 +2,13 @@
|
|||
|
||||
# RUN: lld-link /out:%t.exe /entry:main %t.obj
|
||||
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=BIND %s
|
||||
BIND: IMAGE_DLL_CHARACTERISTICS_NO_BIND
|
||||
# RUN: lld-link /allowbind /out:%t.exe /entry:main %t.obj
|
||||
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=BIND %s
|
||||
BIND-NOT: IMAGE_DLL_CHARACTERISTICS_NO_BIND
|
||||
|
||||
# RUN: lld-link /allowbind:no /out:%t.exe /entry:main %t.obj
|
||||
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=NOBIND %s
|
||||
NOBIND: IMAGE_DLL_CHARACTERISTICS_NO_BIND
|
||||
|
||||
# RUN: lld-link /out:%t.exe /entry:main %t.obj
|
||||
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=ISO %s
|
||||
|
|
Loading…
Reference in New Issue