1# RUN: yaml2obj --docnum=1 %s -o %t1 2# RUN: llvm-readobj --sections %t1 | FileCheck %s 3 4# CHECK: Name: .rela.text 5# CHECK-NEXT: Type: SHT_RELA 6# CHECK-NEXT: Flags [ 7# CHECK-NEXT: ] 8# CHECK-NEXT: Address: 9# CHECK-NEXT: Offset: 10# CHECK-NEXT: Size: 11# CHECK-NEXT: Link: 12# CHECK-NEXT: Info: 12345 13 14--- !ELF 15FileHeader: 16 Class: ELFCLASS64 17 Data: ELFDATA2LSB 18 Type: ET_REL 19Sections: 20 - Name: .rela.text 21 Type: SHT_RELA 22 Info: 12345 23 Relocations: 24 25## Check we report an error when a relocation section references an unknown section via its Info field. 26 27# RUN: not yaml2obj --docnum=2 %s 2>&1 | FileCheck %s --implicit-check-not=error --check-prefix=ERR 28 29# ERR: error: unknown section referenced: '.unknown1' by YAML section '.foo' 30# ERR: error: unknown section referenced: '.unknown2' by YAML section '.bar' 31 32--- !ELF 33FileHeader: 34 Class: ELFCLASS64 35 Data: ELFDATA2LSB 36 Type: ET_REL 37Sections: 38 - Name: .foo 39 Type: SHT_RELA 40 Info: .unknown1 41 Relocations: 42 - Name: .bar 43 Type: SHT_RELA 44 Info: .unknown2 45 Relocations: 46 - Name: .zed 47 Type: SHT_RELA 48 Info: 0xFF 49 Relocations: 50