summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Driver.cpp2
-rw-r--r--lld/test/elf2/basic.s3
2 files changed, 5 insertions, 0 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 6efc5f095aa..938fc2fcbb2 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -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) {
diff --git a/lld/test/elf2/basic.s b/lld/test/elf2/basic.s
index e1bc067b524..58e73c73c71 100644
--- a/lld/test/elf2/basic.s
+++ b/lld/test/elf2/basic.s
@@ -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
OpenPOWER on IntegriCloud