aboutsummaryrefslogtreecommitdiff
path: root/MinGW
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2017-11-15 08:18:11 +0000
committerMartin Storsjo <martin@martin.st>2017-11-15 08:18:11 +0000
commit7fc63936f9814a780043fb5ed3ea1944bcdf6bda (patch)
treed8f5fd9da60f893548cbaa877126ffdc98c9d010 /MinGW
parent102630a7c74aeeee492197e452c4cd465ada7848 (diff)
[MinGW] Add support for --dynamicbase, ignore --nxcompat, --tsaware and --high-entropy-va
All of these are disabled by default in GNU ld, but enabled by default in lld. Disable dynamicbase by default since it potentially could cause compatibility issues, but just ignore the others since the lld default should be fine for most concievable cases. Differential Revision: https://reviews.llvm.org/D40017 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@318281 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'MinGW')
-rw-r--r--MinGW/Driver.cpp2
-rw-r--r--MinGW/Options.td4
2 files changed, 6 insertions, 0 deletions
diff --git a/MinGW/Driver.cpp b/MinGW/Driver.cpp
index eab917c97..44c12520b 100644
--- a/MinGW/Driver.cpp
+++ b/MinGW/Driver.cpp
@@ -157,6 +157,8 @@ bool mingw::link(ArrayRef<const char *> ArgsArr, raw_ostream &Diag) {
if (Args.hasArg(OPT_large_address_aware))
Add("-largeaddressaware");
+ Add(Args.hasArg(OPT_dynamicbase) ? "-dynamicbase" : "-dynamicbase:no");
+
if (auto *A = Args.getLastArg(OPT_m)) {
StringRef S = A->getValue();
if (S == "i386pe")
diff --git a/MinGW/Options.td b/MinGW/Options.td
index dca7de178..306a4252a 100644
--- a/MinGW/Options.td
+++ b/MinGW/Options.td
@@ -6,6 +6,7 @@ class S<string name>: Separate<["--", "-"], name>;
def L: JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">,
HelpText<"Add a directory to the library search path">;
+def dynamicbase: F<"dynamicbase">, HelpText<"Enable ASLR">;
def entry: S<"entry">, MetaVarName<"<entry>">,
HelpText<"Name of entry point symbol">;
def export_all_symbols: F<"export-all-symbols">,
@@ -45,9 +46,12 @@ def O: Joined<["-"], "O">, HelpText<"Optimize output file size">;
def enable_auto_image_base: F<"enable-auto-image-base">;
def enable_auto_import: F<"enable-auto-import">;
def full_shutdown: Flag<["--"], "full-shutdown">;
+def high_entropy_va: F<"high-entropy-va">, HelpText<"Enable 64-bit ASLR">;
def major_image_version: S<"major-image-version">;
def minor_image_version: S<"minor-image-version">;
+def nxcompat: F<"nxcompat">, HelpText<"Enable data execution prevention">;
def sysroot: J<"sysroot">, HelpText<"Sysroot">;
+def tsaware: F<"tsaware">, HelpText<"Create Terminal Server aware executable">;
def v: Flag<["-"], "v">, HelpText<"Display the version number">;
def version: F<"version">, HelpText<"Display the version number and exit">;