mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-01 21:04:04 -04:00
38d4353156
This patch tries to resolve problems faced in D68943 and uses some of the code written by Konrad Wilhelm Kleine in that patch. Previously, yaml2obj tool always created a .symtab section. This patch changes that. With it we only create it when have a "Symbols:" tag in the YAML document or when we need to create it because it is used by another section(s). obj2yaml follows the new behavior and does not print "Symbols:" anymore when there is no symbol table. Differential revision: https://reviews.llvm.org/D69041 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375361 91177308-0d34-0410-b5e6-96231b3b80d8
35 lines
996 B
Plaintext
35 lines
996 B
Plaintext
# RUN: yaml2obj %s > %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
|