1# RUN: yaml2obj -format=elf %s | llvm-readobj -sections -section-data - | FileCheck %s 2# RUN: yaml2obj -format=elf -o %t %s 3# RUN: llvm-readobj -sections -section-data %t | FileCheck %s 4 5!ELF 6FileHeader: 7 Class: ELFCLASS64 8 Data: ELFDATA2LSB 9 Type: ET_REL 10 Machine: EM_X86_64 11Sections: 12 - Name: .text 13 Type: SHT_PROGBITS 14 Flags: [ SHF_ALLOC, SHF_EXECINSTR ] 15 Address: 0xCAFEBABE 16 Link: .text # Doesn't make sense for SHT_PROGBITS, but good enough for test. 17 Content: EBFE 18 AddressAlign: 2 19 20 - Name: .data 21 Type: SHT_PROGBITS 22 Flags: [ SHF_ALLOC ] 23 Address: 0xCAFECAFE 24 Content: FEBF 25 Size: 8 26 AddressAlign: 2 27 28# CHECK: Section { 29# CHECK: Index: 0 30# CHECK: Type: SHT_NULL (0x0) 31# 32# CHECK: Section { 33# CHECK: Name: .text 34# CHECK: Type: SHT_PROGBITS (0x1) 35# CHECK-NEXT: Flags [ (0x6) 36# CHECK-NEXT: SHF_ALLOC (0x2) 37# CHECK-NEXT: SHF_EXECINSTR (0x4) 38# CHECK-NEXT: ] 39# CHECK-NEXT: Address: 0xCAFEBABE 40# CHECK: Size: 2 41# Check that Link != 0. 42# CHECK: Link: {{[1-9][0-9]*}} 43# CHECK: AddressAlignment: 2 44# CHECK: SectionData ( 45# CHECK-NEXT: 0000: EBFE 46# CHECK-NEXT: ) 47# 48# CHECK: Section { 49# CHECK: Name: .data 50# CHECK-NEXT: Type: SHT_PROGBITS (0x1) 51# CHECK-NEXT: Flags [ (0x2) 52# CHECK-NEXT: SHF_ALLOC (0x2) 53# CHECK-NEXT: ] 54# CHECK-NEXT: Address: 0xCAFECAFE 55# CHECK-NEXT: Offset: 0x1D0 56# CHECK-NEXT: Size: 8 57# CHECK-NEXT: Link: 0 58# CHECK-NEXT: Info: 0 59# CHECK-NEXT: AddressAlignment: 2 60# CHECK-NEXT: EntrySize: 0 61# CHECK-NEXT: SectionData ( 62# CHECK-NEXT: 0000: FEBF0000 00000000 |........| 63# CHECK-NEXT: ) 64# 65# CHECK: Section { 66# CHECK: Name: .symtab (25) 67# CHECK: Type: SHT_SYMTAB (0x2) 68# CHECK: } 69# CHECK: Section { 70# CHECK: Name: .strtab (17) 71# CHECK: Type: SHT_STRTAB (0x3) 72# CHECK: } 73# CHECK: Section { 74# CHECK: Name: .shstrtab (7) 75# CHECK: Type: SHT_STRTAB (0x3) 76# CHECK: } 77