forked from OSchip/llvm-project
[Driver] Error out instead of silently ignoring on invalid -z argument.
This matches what both ld.bfd and gold do. llvm-svn: 250775
This commit is contained in:
parent
7d3a2f067f
commit
1ea1fd6b34
|
@ -164,6 +164,8 @@ void LinkerDriver::createFiles(opt::InputArgList &Args) {
|
|||
Config->ZNodelete = true;
|
||||
else if (Arg->getValue() == StringRef("now"))
|
||||
Config->ZNow = true;
|
||||
else
|
||||
error(Twine(Arg->getValue()) + ": unknown -z option");
|
||||
}
|
||||
|
||||
for (auto *Arg : Args) {
|
||||
|
|
|
@ -220,3 +220,6 @@ _start:
|
|||
|
||||
# RUN: not ld.lld2 %t -o %t -m wrong_emul 2>&1 | FileCheck --check-prefix=UNKNOWN_EMUL %s
|
||||
# UNKNOWN_EMUL: Unknown emulation: wrong_emul
|
||||
|
||||
# RUN: not ld.lld2 %t -o %t -z notanoption 2>&1 | FileCheck --check-prefix=UNKNOWN_ZOPT %s
|
||||
# UNKNOWN_ZOPT: notanoption: unknown -z option
|
||||
|
|
Loading…
Reference in New Issue