diff options
Diffstat (limited to 'lld/lib')
-rw-r--r-- | lld/lib/Driver/CoreOptions.td | 3 | ||||
-rw-r--r-- | lld/lib/Driver/Drivers.cpp | 4 | ||||
-rw-r--r-- | lld/lib/Driver/LDOptions.td | 3 | ||||
-rw-r--r-- | lld/lib/Driver/LinkerInvocation.cpp | 6 |
4 files changed, 13 insertions, 3 deletions
diff --git a/lld/lib/Driver/CoreOptions.td b/lld/lib/Driver/CoreOptions.td index 65c97de3b25..143e9974f40 100644 --- a/lld/lib/Driver/CoreOptions.td +++ b/lld/lib/Driver/CoreOptions.td @@ -11,3 +11,6 @@ def relocatable : Flag<["-"], "relocatable">; def OCTOTHORPE_OCTOTHORPE_OCTOTHORPE : Flag<["-"], "###">; def emit_yaml : Flag<["-"], "emit-yaml">; + +def noinhibit_exec : Flag<["-"], "noinhibit-exec">, + HelpText<"Retain the executable output file whenever it is still usable">; diff --git a/lld/lib/Driver/Drivers.cpp b/lld/lib/Driver/Drivers.cpp index fcc6fa8827f..7bce5f2525c 100644 --- a/lld/lib/Driver/Drivers.cpp +++ b/lld/lib/Driver/Drivers.cpp @@ -146,6 +146,9 @@ public: if (llvm::opt::Arg *A = _inputArgs->getLastArg(ld::OPT_emit_yaml)) newArgs->AddFlagArg(A, _core.getOption(core::OPT_emit_yaml)); + if (llvm::opt::Arg *A = _inputArgs->getLastArg(ld::OPT_noinhibit_exec)) + newArgs->AddFlagArg(A, _core.getOption(core::OPT_noinhibit_exec)); + // Copy input args. for (llvm::opt::arg_iterator it = _inputArgs->filtered_begin(ld::OPT_INPUT), ie = _inputArgs->filtered_end(); @@ -228,6 +231,7 @@ LinkerOptions lld::generateOptions(const llvm::opt::ArgList &args) { ret._relocatable = args.hasArg(core::OPT_relocatable); ret._outputCommands = args.hasArg(core::OPT_OCTOTHORPE_OCTOTHORPE_OCTOTHORPE); ret._outputYAML = args.hasArg(core::OPT_emit_yaml); + ret._noInhibitExec = args.hasArg(core::OPT_noinhibit_exec); return std::move(ret); } diff --git a/lld/lib/Driver/LDOptions.td b/lld/lib/Driver/LDOptions.td index 4231fe29019..22148aab38f 100644 --- a/lld/lib/Driver/LDOptions.td +++ b/lld/lib/Driver/LDOptions.td @@ -23,3 +23,6 @@ def m : Separate<["-"], "m">; def static : Flag<["-"], "static">; def L : Joined<["-"], "L">; + +def noinhibit_exec : Flag<["--"], "noinhibit-exec">, + HelpText<"Retain the executable output file whenever it is still usable">; diff --git a/lld/lib/Driver/LinkerInvocation.cpp b/lld/lib/Driver/LinkerInvocation.cpp index d9cda1368d8..be6d951334d 100644 --- a/lld/lib/Driver/LinkerInvocation.cpp +++ b/lld/lib/Driver/LinkerInvocation.cpp @@ -67,11 +67,11 @@ void LinkerInvocation::operator()() { } struct Blah : ResolverOptions { - Blah() + Blah(const LinkerOptions &options) : ResolverOptions() { - _undefinesAreErrors = true; + _undefinesAreErrors = !options._noInhibitExec; } - } ro; + } ro(_options); auto writer = target->getWriter(); |