Debian Codegraph @

llvm/test/tools/llvm-objcopy/ELF/dump-section-before-add-remove.test

raw
1 # RUN: yaml2obj %s -o %t
2
3 ## Verify that section is dumped before it is removed.
4 # RUN: llvm-objcopy --dump-section .test2=%t1.dump -R .test2 %t %t1
5 # RUN: od -t x1 %t1.dump | FileCheck %s --ignore-case --match-full-lines
6
7 # CHECK: 0000000 de ad be ef
8 # CHECK-NEXT: 0000004
9
10 ## Verify that the newly added section is not dumped.
11 # RUN: echo CAFE > %t3.txt
12 # RUN: not llvm-objcopy --dump-section .test3=%t3.dump --add-section .test3=%t3.txt %t %t3 2>&1 | \
13 # RUN: FileCheck %s --check-prefix=NODUMP -DINPUT=%t
14
15 # NODUMP: error: '[[INPUT]]': section '.test3' not found
16
17 !ELF
18 FileHeader:
19 Class: ELFCLASS64
20 Data: ELFDATA2LSB
21 Type: ET_REL
22 Machine: EM_X86_64
23 Sections:
24 - Name: .test1
25 Type: SHT_PROGBITS
26 Flags: [ ]
27 - Name: .test2
28 Type: SHT_PROGBITS
29 Flags: [ ]
30 Content: "DEADBEEF"
31 - Name: .test4
32 Type: SHT_PROGBITS
33 Flags: [ ]
34 Content: "BEEFDEAD"
35 Symbols: []