summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Driver.cpp2
-rw-r--r--lld/test/ELF/oformat-binary.s2
2 files changed, 4 insertions, 0 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 50555fb1cd2..693dba64ab5 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -501,6 +501,8 @@ static bool isOutputFormatBinary(opt::InputArgList &Args) {
StringRef S = Arg->getValue();
if (S == "binary")
return true;
+ if (S.startswith("elf"))
+ return false;
error("unknown --oformat value: " + S);
}
return false;
diff --git a/lld/test/ELF/oformat-binary.s b/lld/test/ELF/oformat-binary.s
index 44c7b5ac2d8..e68f07c5773 100644
--- a/lld/test/ELF/oformat-binary.s
+++ b/lld/test/ELF/oformat-binary.s
@@ -19,6 +19,8 @@
# RUN: | FileCheck %s --check-prefix ERR
# ERR: unknown --oformat value: foo
+# RUN: ld.lld -o /dev/null %t --oformat elf
+
.text
.align 4
.globl _start
OpenPOWER on IntegriCloud