• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: yaml2obj %s -o %t
2# RUN: llvm-objcopy --keep-section=.test2 --only-section=.test %t %t2
3# RUN: llvm-objcopy -j .test --keep-section=.test2 %t %t3
4# RUN: llvm-readobj --file-headers --sections %t2 | FileCheck %s
5# RUN: diff %t2 %t3
6# RUN: llvm-objcopy --regex --keep-section='^.test$'  --only-section='^.test[2-3]+$' %t %t4
7# RUN: llvm-readobj --file-headers --sections %t4 | FileCheck %s --check-prefix=REGEX
8
9!ELF
10FileHeader:
11  Class:           ELFCLASS64
12  Data:            ELFDATA2LSB
13  Type:            ET_REL
14  Machine:         EM_X86_64
15Sections:
16  - Name:            .test
17    Type:            SHT_PROGBITS
18  - Name:            .test2
19    Type:            SHT_PROGBITS
20  - Name:            .test3
21    Type:            SHT_PROGBITS
22
23# CHECK: SectionHeaderCount: 4
24
25# CHECK:     Name: .test
26# CHECK:     Name: .test2
27# CHECK:     Name: .shstrtab
28
29# REGEX: SectionHeaderCount: 5
30
31# REGEX:     Name: .test
32# REGEX:     Name: .test2
33# REGEX:     Name: .test3
34# REGEX:     Name: .shstrtab
35