Allow oformat to accept format starting with elf as acceptable format. isOutputFormatBinary returns false in such case.

Example: --oformat elf64-x86-64

Differential Revision: https://reviews.llvm.org/D50105

llvm-svn: 338445
This commit is contained in:
Rumeet Dhindsa 2018-07-31 21:58:26 +00:00
parent acbbf4bf78
commit 9d9113fc13
2 changed files with 4 additions and 0 deletions

View File

@ -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;

View File

@ -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