1 # RUN: yaml2obj %s > %t
2 # RUN: llvm-objcopy -O binary -j .test2 %t %t.sec
3 # RUN: llvm-objcopy -R .test2 %t %t2
4 # RUN: llvm-objcopy --add-section=.test2=%t.sec %t2 %t3
5 # RUN: llvm-readobj --file-headers --sections --section-data %t3 | FileCheck %s
27 # CHECK: SectionHeaderCount: 6
31 # CHECK: Name: .strtab
32 # CHECK: Name: .shstrtab
34 # CHECK: SectionData (
35 # CHECK-NEXT: 0000: DEADBEEF
38 ## Test that llvm-objcopy produces an error if the file with section contents
39 ## to be added does not exist.
40 # RUN: not llvm-objcopy --add-section=.section.name=%t.missing %t %t.out 2>&1 | FileCheck -DFILE1=%t -DFILE2=%t.missing %s --check-prefixes=ERR1
42 # ERR1: error: '[[FILE1]]': '[[FILE2]]': {{[Nn]}}o such file or directory
44 ## Negative test for invalid --add-sections argument - missing '='.
45 # RUN: not llvm-objcopy --add-section=.section.name %t %t.out 2>&1 | FileCheck %s --check-prefixes=ERR2
47 # ERR2: error: bad format for --add-section: missing '='
49 ## Negative test for invalid --add-sections argument - missing file name.
50 # RUN: not llvm-objcopy --add-section=.section.name= %t %t.out 2>&1 | FileCheck %s --check-prefixes=ERR3
52 # ERR3: error: bad format for --add-section: missing file name