1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00
llvm-mirror/test/Object/obj2yaml-sectiongroup.test
Chris Bieneman 1f183c5130 [yaml2obj] Remove --format option in favor of YAML tags
Summary:
Our YAML library's handling of tags isn't perfect, but it is good enough to get rid of the need for the --format argument to yaml2obj. This patch does exactly that.

Instead of requiring --format, it infers the format based on the tags found in the object file. The supported tags are:

!ELF
!COFF
!mach-o
!fat-mach-o

I have a corresponding patch that is quite large that fixes up all the in-tree test cases.

Reviewers: rafael, Bigcheese, compnerd, silvas

Subscribers: compnerd, llvm-commits

Differential Revision: http://reviews.llvm.org/D21711

llvm-svn: 273915
2016-06-27 19:53:53 +00:00

27 lines
979 B
Plaintext

# Checks that the tool is able to read section groups with ELF.
RUN: obj2yaml %p/Inputs/sectionGroup.elf.x86-64 > %t1.sectiongroup.yaml
RUN: FileCheck %s --check-prefix ELF-GROUP < %t1.sectiongroup.yaml
RUN: yaml2obj %t1.sectiongroup.yaml -o %t2.o.elf
RUN: llvm-readobj -sections %t2.o.elf | FileCheck %s -check-prefix=SECTIONS
#ELF-GROUP: - Name: .group
#ELF-GROUP: Type: SHT_GROUP
#ELF-GROUP: Link: .symtab
#ELF-GROUP: Info: a
#ELF-GROUP: Members:
#ELF-GROUP: - SectionOrType: GRP_COMDAT
#ELF-GROUP: - SectionOrType: .rodata.a
#SECTIONS: Format: ELF64-x86-64
#SECTIONS: Arch: x86_64
#SECTIONS: AddressSize: 64bit
#SECTIONS: Section {
#SECTIONS: Index: 1
#SECTIONS: Name: .group (21)
#SECTIONS: Type: SHT_GROUP (0x11)
#SECTIONS: Flags [ (0x0)
#SECTIONS: ]
#SECTIONS: Address: 0x0
#SECTIONS: Size: 8
#SECTIONS: AddressAlignment: 4
#SECTIONS: EntrySize: 4
#SECTIONS: }