aboutsummaryrefslogtreecommitdiff
path: root/COFF
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-09-15 22:49:13 +0000
committerRui Ueyama <ruiu@google.com>2017-09-15 22:49:13 +0000
commit2723d2fc5650609a26a5c77850ca54d152765d42 (patch)
treef689320ed275606c5bb26b84155db7a48e92e23d /COFF
parent5aece716dd82c5e4bbc410bcd4817715981500e6 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@313414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'COFF')
-rw-r--r--COFF/Config.h1
-rw-r--r--COFF/Driver.cpp2
-rw-r--r--COFF/Writer.cpp9
3 files changed, 5 insertions, 7 deletions
diff --git a/COFF/Config.h b/COFF/Config.h
index 0b8489b7c..995a398a3 100644
--- a/COFF/Config.h
+++ b/COFF/Config.h
@@ -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;
diff --git a/COFF/Driver.cpp b/COFF/Driver.cpp
index 0cae83461..6785111ac 100644
--- a/COFF/Driver.cpp
+++ b/COFF/Driver.cpp
@@ -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))
diff --git a/COFF/Writer.cpp b/COFF/Writer.cpp
index 799611f39..66e481865 100644
--- a/COFF/Writer.cpp
+++ b/COFF/Writer.cpp
@@ -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)