aboutsummaryrefslogtreecommitdiff
path: root/lld/MinGW/Driver.cpp
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2021-08-11 23:41:24 +0300
committerMartin Storsjö <martin@martin.st>2021-08-12 13:27:09 +0300
commitf8340c8c5de6273c2f000a8cef7e1de056b34332 (patch)
tree709791b9e246a80609816dea5a0fcfc1178c24f8 /lld/MinGW/Driver.cpp
parent1f87c7c478a657d7b0ac224ca4c6d8999a7fa35b (diff)
downloadllvm-f8340c8c5de6273c2f000a8cef7e1de056b34332.zip
llvm-f8340c8c5de6273c2f000a8cef7e1de056b34332.tar.gz
llvm-f8340c8c5de6273c2f000a8cef7e1de056b34332.tar.bz2
[LLD] [MinGW] Add more options for disabling flags in the executable
In e72403f96de7f1c681acd5968f72aa986412dfce, we added the flag "--no-dynamicbase" for disabling the dynamicbase flag which we set by default. At the time, ld.bfd didn't have any corresponding option (as ld.bfd defaulted to not setting the flag). Almost at the same time, corresponding options were added to ld.bfd for disabling it (while it was being enabled by default), with a different name, "--disable-dynamicbase". Thus add the "--disable-dynamicbase" option. Make this default one advertised in the help listing, but keep the "--no-dynamicbase" form as an alias. Also improve checking for the last option set if there are multiple ones on the same command line. Also add corresponding disable options for a lot of other flags that we set by default, also added in ld.bfd in the same commit: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=514b4e191d5f46de8e142fe216e677a35fa9c4bb Differential Revision: https://reviews.llvm.org/D107930
Diffstat (limited to 'lld/MinGW/Driver.cpp')
-rw-r--r--lld/MinGW/Driver.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp
index 4a3a9ef..7c6b865 100644
--- a/lld/MinGW/Driver.cpp
+++ b/lld/MinGW/Driver.cpp
@@ -308,13 +308,19 @@ bool mingw::link(ArrayRef<const char *> argsArr, bool canExitEarly,
add("-kill-at");
if (args.hasArg(OPT_appcontainer))
add("-appcontainer");
- if (args.hasArg(OPT_no_seh))
+ if (args.hasFlag(OPT_no_seh, OPT_disable_no_seh, false))
add("-noseh");
if (args.getLastArgValue(OPT_m) != "thumb2pe" &&
args.getLastArgValue(OPT_m) != "arm64pe" &&
- args.hasArg(OPT_no_dynamicbase))
+ args.hasFlag(OPT_disable_dynamicbase, OPT_dynamicbase, false))
add("-dynamicbase:no");
+ if (args.hasFlag(OPT_disable_high_entropy_va, OPT_high_entropy_va, false))
+ add("-highentropyva:no");
+ if (args.hasFlag(OPT_disable_nxcompat, OPT_nxcompat, false))
+ add("-nxcompat:no");
+ if (args.hasFlag(OPT_disable_tsaware, OPT_tsaware, false))
+ add("-tsaware:no");
if (args.hasFlag(OPT_no_insert_timestamp, OPT_insert_timestamp, false))
add("-timestamp:0");