1## Test common parsing errors general to all supported binary formats.
2
3# RUN: yaml2obj %s -o %t
4
5# RUN: not llvm-objcopy --redefine-sym bar %t /dev/null 2>&1 | FileCheck %s --check-prefix=BAD-FORMAT
6# BAD-FORMAT: bad format for --redefine-sym
7
8# RUN: not llvm-objcopy --redefine-sym foo=f1 --redefine-sym foo=f2 %t /dev/null 2>&1 | FileCheck %s --check-prefix=MULTIPLE-REDEFINITION
9# MULTIPLE-REDEFINITION: multiple redefinition of symbol 'foo'
10
11# RUN: echo '  foo   oof #rename foo  ' > %t.rename.txt
12# RUN: echo 'bar' >> %t.rename.txt
13# RUN: not llvm-objcopy --redefine-syms %t.rename.txt %t /dev/null 2>&1 | FileCheck %s --check-prefix=MISSING-SYM-NAME
14# MISSING-SYM-NAME: error: {{.*}}.rename.txt:2: missing new symbol name
15
16# RUN: not llvm-objcopy --redefine-syms %t.rename-none.txt %t /dev/null 2>&1 | FileCheck %s --check-prefix=NO-FILE
17# NO-FILE: error: '{{.*}}.rename-none.txt': {{[Nn]}}o such file or directory
18
19!ELF
20FileHeader:
21  Class:   ELFCLASS64
22  Data:    ELFDATA2LSB
23  Type:    ET_EXEC
24  Machine: EM_X86_64
25Sections:
26  - Name:  .text
27    Type:  SHT_PROGBITS
28    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
29Symbols:
30  - Name:    foo
31    Section: .text
32  - Name:    bar
33    Section: .text
34