1## Test that a relocation's symbol can be an integer (symbol index). 2 3# RUN: yaml2obj %s -o %t 4## LLVM tools (both llvm-readobj and llvm-objdump) reject relocations with 5## invalid symbol indexes, so inspect the hex contents instead. 6# RUN: llvm-readobj -x .rela.text %t | FileCheck %s 7 8# CHECK: Hex dump of section '.rela.text': 9# CHECK-NEXT: 0x00000000 00000000 00000000 02000000 42000000 10# Symbol index 0x42 --^ 11# CHECK-NEXT: 0x00000010 00000000 00000000 00000000 00000000 12# CHECK-NEXT: 0x00000020 02000000 01000000 00000000 00000000 13# Symbol index 0x01 --^ 14 15--- !ELF 16FileHeader: 17 Class: ELFCLASS64 18 Data: ELFDATA2LSB 19 Type: ET_REL 20 Machine: EM_X86_64 21Sections: 22 - Name: .text 23 Type: SHT_PROGBITS 24 - Name: .rela.text 25 Type: SHT_RELA 26 Info: .text 27 Link: .symtab 28 Relocations: 29 - Type: R_X86_64_PC32 30 Symbol: 0x42 31 - Type: R_X86_64_PC32 32 Symbol: 0x1 33Symbols: 34 - Name: foo 35 Binding: STB_GLOBAL 36