diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td index 7f04e052fd3171..3bb358c457d3cf 100644 --- a/lld/ELF/Options.td +++ b/lld/ELF/Options.td @@ -304,8 +304,8 @@ def no_undefined: F<"no-undefined">, def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"">, HelpText<"Path to file to write output">; -def oformat: Separate<["--"], "oformat">, MetaVarName<"">, - HelpText<"Specify the binary format for the output object file">; +defm oformat: EEq<"oformat", "Specify the binary format for the output object file">, + MetaVarName<"[elf,binary]">; def omagic: FF<"omagic">, MetaVarName<"">, HelpText<"Set the text and data sections to be readable and writable, do not page align sections, link against static libraries">; diff --git a/lld/test/ELF/oformat-binary.s b/lld/test/ELF/oformat-binary.s index 4b2ad8ec711fdc..38af6805140fce 100644 --- a/lld/test/ELF/oformat-binary.s +++ b/lld/test/ELF/oformat-binary.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t -# RUN: ld.lld -o %t.out %t --oformat binary +# RUN: ld.lld -o %t.out %t --oformat=binary # RUN: od -t x1 -v %t.out | FileCheck %s # CHECK: 0000000 90 11 22 # CHECK-NEXT: 0000003 @@ -46,7 +46,7 @@ # ERR: unknown --oformat value: foo # RUN: ld.lld -o /dev/null %t --oformat elf -# RUN: ld.lld -o /dev/null %t --oformat elf-foo +# RUN: ld.lld -o /dev/null %t --oformat=elf-foo .text .align 4