Index: test/tools/llvm-objcopy/basic-strip.test =================================================================== --- test/tools/llvm-objcopy/basic-strip.test +++ test/tools/llvm-objcopy/basic-strip.test @@ -1,5 +1,5 @@ # RUN: yaml2obj %s > %t -# RUN: llvm-strip %t %t2 +# RUN: llvm-strip %t -o %t2 # RUN: llvm-readobj -file-headers -sections %t2 | FileCheck %s !ELF Index: test/tools/llvm-objcopy/explicit-out.test =================================================================== --- /dev/null +++ test/tools/llvm-objcopy/explicit-out.test @@ -0,0 +1,23 @@ +# RUN: yaml2obj %s > %t +# RUN: llvm-objcopy %t -o %t2 +# RUN: llvm-objcopy %t %t3 +# RUN: diff %t2 %t3 + +!ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 +Sections: + - Name: .bss + Type: SHT_NOBITS + Flags: [ SHF_ALLOC ] + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + - Name: .blarg + Type: SHT_PROGBITS + Flags: [ ] + - Name: .gnu.warning.foo + Type: SHT_PROGBITS Index: tools/llvm-objcopy/llvm-objcopy.cpp =================================================================== --- tools/llvm-objcopy/llvm-objcopy.cpp +++ tools/llvm-objcopy/llvm-objcopy.cpp @@ -276,6 +276,8 @@ static cl::opt InputFilename(cl::Positional, cl::desc("")); static cl::opt OutputFilename(cl::Positional, cl::desc("")); +static cl::alias ExplicitOutput("o", cl::desc("file to output to"), + cl::aliasopt(OutputFilename)); static cl::opt OutputFormat("O", cl::desc("Set output format to one of the following:" "\n\tbinary\n\telf"), cl::init("elf"));