Files
clang-p2996/llvm/test/tools/llvm-objcopy/ELF/keep-only-section.test
Fangrui Song 55c81d4282 [test] Use yaml2obj -o %t instead of > %t
To improve consistency and avoid unneeded shell feature (output
redirection).

While here, make other changes to improve consistency

--docnum 1 => --docnum=1
-docnum=x => --docnum=x
2020-01-21 17:20:18 -08:00

35 lines
997 B
Plaintext

# RUN: yaml2obj %s -o %t
# RUN: llvm-objcopy --keep-section=.test2 --only-section=.test %t %t2
# RUN: llvm-objcopy -j .test --keep-section=.test2 %t %t3
# RUN: llvm-readobj --file-headers --sections %t2 | FileCheck %s
# RUN: diff %t2 %t3
# RUN: llvm-objcopy --regex --keep-section='^.test$' --only-section='^.test[2-3]+$' %t %t4
# RUN: llvm-readobj --file-headers --sections %t4 | FileCheck %s --check-prefix=REGEX
!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .test
Type: SHT_PROGBITS
- Name: .test2
Type: SHT_PROGBITS
- Name: .test3
Type: SHT_PROGBITS
# CHECK: SectionHeaderCount: 4
# CHECK: Name: .test
# CHECK: Name: .test2
# CHECK: Name: .shstrtab
# REGEX: SectionHeaderCount: 5
# REGEX: Name: .test
# REGEX: Name: .test2
# REGEX: Name: .test3
# REGEX: Name: .shstrtab