Debian Codegraph @

llvm/test/tools/llvm-objcopy/ELF/remove-section-with-symbol.test

raw
1 # RUN: yaml2obj %s -o %t
2 # RUN: llvm-objcopy -R .test %t %t2
3 # RUN: llvm-readobj --file-headers --symbols %t2 | FileCheck %s
4
5 !ELF
6 FileHeader:
7 Class: ELFCLASS64
8 Data: ELFDATA2LSB
9 Type: ET_REL
10 Machine: EM_X86_64
11 Sections:
12 - Name: .test
13 Type: SHT_PROGBITS
14 Flags: [ SHF_ALLOC ]
15 - Name: .test2
16 Type: SHT_PROGBITS
17 Flags: [ SHF_ALLOC ]
18 Symbols:
19 - Name: test
20 Type: STT_FUNC
21 Section: .test
22 Value: 0x1000
23 Size: 4
24 Binding: STB_GLOBAL
25 - Name: test2
26 Type: STT_FUNC
27 Section: .test2
28 Value: 0x1000
29 Size: 4
30 Binding: STB_GLOBAL
31
32 # The sections counted here should be .test, .symtab, .strtab, and .shstrtab.
33 # The 5th section is the null section.
34 #CHECK: SectionHeaderCount: 5
35
36 #CHECK: Symbols [
37 #CHECK-NEXT: Symbol {
38 #CHECK-NEXT: Name:
39 #CHECK-NEXT: Value: 0x0
40 #CHECK-NEXT: Size: 0
41 #CHECK-NEXT: Binding: Local
42 #CHECK-NEXT: Type: None
43 #CHECK-NEXT: Other: 0
44 #CHECK-NEXT: Section: Undefined
45 #CHECK-NEXT: }
46 #CHECK-NEXT: Symbol {
47 #CHECK-NEXT: Name: test2
48 #CHECK-NEXT: Value: 0x1000
49 #CHECK-NEXT: Size: 4
50 #CHECK-NEXT: Binding: Global
51 #CHECK-NEXT: Type: Function
52 #CHECK-NEXT: Other: 0
53 #CHECK-NEXT: Section: .test2
54 #CHECK-NEXT: }
55 #CHECK-NEXT:]