blob: 33ccf78756f11109bef640e160715326703e3650 [file] [log] [blame]
Jake Ehrlich1bfefc12017-11-13 22:13:08 +00001# RUN: yaml2obj %s > %t
2# RUN: llvm-objcopy -strip-debug %t %t2
3# RUN: llvm-readobj -file-headers -sections -symbols %t2 | FileCheck %s
4
Alexander Shaposhnikovcca69982018-05-07 19:32:09 +00005# We run yaml2obj again rather than copy %t to avoid interfering
6# with llvm-objcopy's test (which potentially could have corrupted/updated the binary).
7
8# RUN: yaml2obj %s > %t3
9# RUN: llvm-strip -strip-debug %t3
10# RUN: llvm-readobj -file-headers -sections -symbols %t3 | FileCheck %s
11# RUN: cmp %t2 %t3
12
Jake Ehrlich1bfefc12017-11-13 22:13:08 +000013!ELF
14FileHeader:
15 Class: ELFCLASS64
16 Data: ELFDATA2LSB
17 Type: ET_REL
18 Machine: EM_X86_64
19Sections:
20 - Name: .debugfoo
21 Type: SHT_PROGBITS
22 Content: "00000000"
23 - Name: .text
24 Type: SHT_PROGBITS
25 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
26 AddressAlign: 0x0000000000000010
27 Content: "00000000"
28Symbols:
29 Global:
30 - Name: foo
31 Section: .text
32 - Name: debugfoo
33 Section: .debugfoo
34
35# CHECK: SectionHeaderCount: 5
36
37# CHECK: Name: .text
38# CHECK: Name: .symtab
39# CHECK: Name: .strtab
40# CHECK: Name: .shstrtab
41
42# Check that *only* foo is copied and not debugfoo
43# CHECK: Symbols [
44# CHECK-NEXT: Symbol {
45# CHECK-NEXT: Name:
46# CHECK-NEXT: Value:
47# CHECK-NEXT: Size:
48# CHECK-NEXT: Binding:
49# CHECK-NEXT: Type:
50# CHECK-NEXT: Other:
51# CHECK-NEXT: Section: Undefined
52# CHECK-NEXT: }
53# CHECK-NEXT: Symbol {
54# CHECK-NEXT: Name: foo
55# CHECK-NEXT: Value:
56# CHECK-NEXT: Size:
57# CHECK-NEXT: Binding: Global
58# CHECK-NEXT: Type:
59# CHECK-NEXT: Other:
60# CHECK-NEXT: Section: .text
61# CHECK-NEXT: }
62# CHECK-NEXT: ]