1# RUN: yaml2obj %s -o %t.o 2# RUN: llvm-readobj --demangle -r %t.o | FileCheck %s --check-prefix LLVM 3# RUN: llvm-readelf --demangle -r %t.o | FileCheck %s --check-prefix GNU 4 5# GNU: Relocation section '.rela.plt' at offset {{.*}} contains 5 entries: 6# GNU-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend 7# GNU-NEXT: 0000000000013018 0000000100000007 R_X86_64_JUMP_SLOT 0000000000000000 f1@v3 + 0 8# GNU-NEXT: 0000000000013020 0000000200000007 R_X86_64_JUMP_SLOT 0000000000000000 f2@v2 + 0 9# GNU-NEXT: 0000000000013028 0000000300000007 R_X86_64_JUMP_SLOT 0000000000000000 g1@v1 + 0 10# GNU-NEXT: 0000000000013040 0000000400000007 R_X86_64_JUMP_SLOT 0000000000000000 f1()@v3 + 0 11# GNU-NEXT: 0000000000013058 0000000500000007 R_X86_64_JUMP_SLOT 0000000000000000 f3 + 0 12 13# LLVM: Relocations [ 14# LLVM-NEXT: Section (3) .rela.plt { 15# LLVM-NEXT: 0x13018 R_X86_64_JUMP_SLOT f1@v3 0x0 16# LLVM-NEXT: 0x13020 R_X86_64_JUMP_SLOT f2@v2 0x0 17# LLVM-NEXT: 0x13028 R_X86_64_JUMP_SLOT g1@v1 0x0 18# LLVM-NEXT: 0x13040 R_X86_64_JUMP_SLOT f1()@v3 0x0 19# LLVM-NEXT: 0x13058 R_X86_64_JUMP_SLOT f3 0x0 20# LLVM-NEXT: } 21# LLVM-NEXT: ] 22 23--- !ELF 24FileHeader: 25 Class: ELFCLASS64 26 Data: ELFDATA2LSB 27 Type: ET_EXEC 28 Machine: EM_X86_64 29Sections: 30 - Name: .gnu.version 31 Type: SHT_GNU_versym 32 Flags: [ SHF_ALLOC ] 33 Entries: [ 0, 2, 3, 4, 2 ] 34 - Name: .gnu.version_r 35 Type: SHT_GNU_verneed 36 Flags: [ SHF_ALLOC ] 37 Link: .dynstr 38 AddressAlign: 0x0000000000000004 39 Info: 0x0000000000000002 40 Dependencies: 41 - Version: 1 42 File: verneed1.so.0 43 Entries: 44 - Name: v2 45 Hash: 1938 46 Flags: 0 47 Other: 3 48 - Name: v3 49 Hash: 1939 50 Flags: 0 51 Other: 2 52 - Version: 1 53 File: verneed2.so.0 54 Entries: 55 - Name: v1 56 Hash: 1937 57 Flags: 0 58 Other: 4 59 - Name: .rela.plt 60 Type: SHT_RELA 61 Flags: [ SHF_ALLOC ] 62 Link: .dynsym 63 Relocations: 64 - Offset: 0x0000000000013018 65 Symbol: f1 66 Type: R_X86_64_JUMP_SLOT 67 - Offset: 0x0000000000013020 68 Symbol: f2 69 Type: R_X86_64_JUMP_SLOT 70 - Offset: 0x0000000000013028 71 Symbol: g1 72 Type: R_X86_64_JUMP_SLOT 73 - Offset: 0x0000000000013040 74 Symbol: _Z2f1v 75 Type: R_X86_64_JUMP_SLOT 76 - Offset: 0x0000000000013058 77 Symbol: f3 78 Type: R_X86_64_JUMP_SLOT 79DynamicSymbols: 80 - Name: f1 81 Binding: STB_GLOBAL 82 - Name: f2 83 Binding: STB_GLOBAL 84 - Name: g1 85 Binding: STB_GLOBAL 86 - Name: _Z2f1v 87 Binding: STB_GLOBAL 88 - Name: f3 89 Binding: STB_GLOBAL 90