96 lines · plain
1# RUN: yaml2obj %s -o %t2# RUN: llvm-objcopy %t %t23# RUN: llvm-readobj --relocations %t2 | FileCheck %s4 5!ELF6FileHeader:7 Class: ELFCLASS648 Data: ELFDATA2LSB9 Type: ET_EXEC10 Machine: EM_X86_6411Sections:12 - Name: .text13 Type: SHT_PROGBITS14 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]15 Address: 0x100016 AddressAlign: 0x000000000000001017 Content: "0000000000000000"18 - Name: .rel.text19 Type: SHT_REL20 Link: .symtab21 Info: .text22 Relocations:23 - Offset: 0x100024 Symbol: foo25 Type: R_X86_64_PC3226 - Name: .data27 Type: SHT_PROGBITS28 Flags: [ SHF_ALLOC ]29 Address: 0x200030 AddressAlign: 0x000000000000001031 Content: "0000000000000000"32 - Name: .rel.data33 Type: SHT_REL34 Link: .symtab35 Info: .data36 Relocations:37 - Offset: 0x200038 Symbol: bar39 Type: R_X86_64_PC3240 - Name: .rela.data41 Type: SHT_RELA42 Link: .symtab43 Info: .data44 Relocations:45 - Offset: 0x200046 Symbol: barA47 Type: R_X86_64_PC3248 Addend: 0x1749 - Name: .rela.text50 Type: SHT_RELA51 Link: .symtab52 Info: .text53 Relocations:54 - Offset: 0x100055 Symbol: fooA56 Type: R_X86_64_PC3257 Addend: 0x1358Symbols:59 - Name: _start60 Type: STT_FUNC61 Section: .text62 Value: 0x100063 Size: 464 Binding: STB_GLOBAL65 - Name: foo66 Type: STT_FUNC67 Size: 468 Binding: STB_GLOBAL69 - Name: fooA70 Type: STT_FUNC71 Size: 472 Binding: STB_GLOBAL73 - Name: bar74 Type: STT_OBJECT75 Size: 476 Binding: STB_GLOBAL77 - Name: barA78 Type: STT_OBJECT79 Size: 480 Binding: STB_GLOBAL81 82# CHECK: Relocations [83# CHECK-NEXT: Section (2) .rel.text {84# CHECK-NEXT: 0x1000 R_X86_64_PC32 foo85# CHECK-NEXT: }86# CHECK-NEXT: Section (4) .rel.data {87# CHECK-NEXT: 0x2000 R_X86_64_PC32 bar88# CHECK-NEXT: }89# CHECK-NEXT: Section (5) .rela.data {90# CHECK-NEXT: 0x2000 R_X86_64_PC32 barA 0x1791# CHECK-NEXT: }92# CHECK-NEXT: Section (6) .rela.text {93# CHECK-NEXT: 0x1000 R_X86_64_PC32 fooA 0x1394# CHECK-NEXT: }95# CHECK-NEXT:]96