1 # RUN: yaml2obj %s -o %t
2 # RUN: llvm-objcopy -O binary -j .text %t %t2
3 # RUN: llvm-objcopy -O binary --only-section .text %t %t3
4 # RUN: llvm-objcopy --dump-section .text=%t4 %t %t5
5 # RUN: llvm-objcopy --dump-section .foo=%t6 %t %t7
6 # RUN: not llvm-objcopy --dump-section .bar=%t8 %t %t9 2>&1 | FileCheck %s --check-prefix=NOBITS -DINPUT=%t
7 # RUN: llvm-objcopy --dump-section .text=%t10 --dump-section .foo=%t11 %t /dev/null
8 # RUN: llvm-objcopy --dump-section .empty=%t.empty %t /dev/null
9 # RUN: od -t x1 %t2 | FileCheck %s --ignore-case
10 # RUN: od -t x1 %t6 | FileCheck %s --ignore-case --check-prefix=NON-ALLOC
11 # RUN: wc -c %t2 | FileCheck %s --check-prefix=SIZE
12 # RUN: wc -c %t.empty | FileCheck %s --check-prefix=EMPTY
27 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
28 AddressAlign: 0x0000000000001000
46 # CHECK: 0000000 de ad be ef
48 # NON-ALLOC: 0000000 ca fe
52 # NOBITS: error: '[[INPUT]]': cannot dump section '.bar': it has no contents
56 # RUN: not llvm-objcopy --dump-section =/dev/null %t /dev/null 2>&1 | \
57 # RUN: FileCheck %s --check-prefix=ERR -DFILE=%t "-DSECTION="
58 # RUN: not llvm-objcopy --dump-section .missing=/dev/null %t /dev/null 2>&1 | \
59 # RUN: FileCheck %s --check-prefix=ERR -DFILE=%t -DSECTION=.missing
61 # ERR: error: '[[FILE]]': section '[[SECTION]]' not found
63 # RUN: not llvm-objcopy --dump-section .text %t /dev/null 2>&1 | FileCheck %s --check-prefix=ERR2
64 # RUN: not llvm-objcopy --dump-section .text= %t /dev/null 2>&1 | FileCheck %s --check-prefix=ERR2
66 # ERR2: error: bad format for --dump-section, expected section=file