mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 14:46:53 +00:00
9cf90e65d1
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273915 91177308-0d34-0410-b5e6-96231b3b80d8
53 lines
1.8 KiB
YAML
53 lines
1.8 KiB
YAML
# RUN: yaml2obj %s > %t
|
|
# RUN: llvm-readobj -file-headers %t | FileCheck -check-prefix=OBJ %s
|
|
# RUN: obj2yaml %t | FileCheck -check-prefix=YAML %s
|
|
|
|
# OBJ: Flags [ (0x9E8B1727)
|
|
# OBJ-NEXT: EF_MIPS_32BITMODE (0x100)
|
|
# OBJ-NEXT: EF_MIPS_ABI2 (0x20)
|
|
# OBJ-NEXT: EF_MIPS_ABI_O32 (0x1000)
|
|
# OBJ-NEXT: EF_MIPS_ARCH_32R6 (0x90000000)
|
|
# OBJ-NEXT: EF_MIPS_ARCH_ASE_M16 (0x4000000)
|
|
# OBJ-NEXT: EF_MIPS_ARCH_ASE_MDMX (0x8000000)
|
|
# OBJ-NEXT: EF_MIPS_CPIC (0x4)
|
|
# OBJ-NEXT: EF_MIPS_FP64 (0x200)
|
|
# OBJ-NEXT: EF_MIPS_MACH_OCTEON (0x8B0000)
|
|
# OBJ-NEXT: EF_MIPS_MICROMIPS (0x2000000)
|
|
# OBJ-NEXT: EF_MIPS_NAN2008 (0x400)
|
|
# OBJ-NEXT: EF_MIPS_NOREORDER (0x1)
|
|
# OBJ-NEXT: EF_MIPS_PIC (0x2)
|
|
# OBJ-NEXT: ]
|
|
|
|
# YAML: FileHeader:
|
|
# YAML-NEXT: Class: ELFCLASS32
|
|
# YAML-NEXT: Data: ELFDATA2LSB
|
|
# YAML-NEXT: Type: ET_REL
|
|
# YAML-NEXT: Machine: EM_MIPS
|
|
# YAML-NEXT: Flags: [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI2, EF_MIPS_32BITMODE, EF_MIPS_FP64, EF_MIPS_NAN2008, EF_MIPS_MICROMIPS, EF_MIPS_ARCH_ASE_M16, EF_MIPS_ARCH_ASE_MDMX, EF_MIPS_ABI_O32, EF_MIPS_MACH_OCTEON, EF_MIPS_ARCH_32R6 ]
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [ EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ABI2,
|
|
EF_MIPS_32BITMODE, EF_MIPS_FP64, EF_MIPS_NAN2008,
|
|
EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R6,
|
|
EF_MIPS_MICROMIPS, EF_MIPS_ARCH_ASE_M16,
|
|
EF_MIPS_ARCH_ASE_MDMX, EF_MIPS_MACH_OCTEON ]
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
AddressAlign: 16
|
|
Size: 4
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: T1
|
|
Section: .text
|
|
Value: 0
|
|
Size: 4
|
|
...
|