brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · c788a40 Raw
68 lines · yaml
1## Show that yaml2obj uses the correct set of symbols for relocation sections2## referencing the dynamic symbol table.3 4# RUN: yaml2obj %s -o %t5# RUN: llvm-readelf -r %t | FileCheck %s6 7# RUN: yaml2obj -DTYPE=SHT_CREL %s -o %t.crel8# RUN: llvm-readelf -r %t.crel | FileCheck %s9 10# CHECK:      Relocation section '.rela.dyn' at offset {{.*}} contains 2 entries:11# CHECK-NEXT:     Offset             Info             Type      Symbol's Value  Symbol's Name12# CHECK-NEXT: 0000000000000000  0000000100000000 R_X86_64_NONE 0000000012345678 dynamic13# CHECK-NEXT: 0000000000000008  0000000200000000 R_X86_64_NONE 0000000087654321 both14# CHECK-EMPTY:15# CHECK-NEXT: Relocation section '.rela.data' at offset {{.*}} contains 2 entries:16# CHECK-NEXT:     Offset             Info             Type      Symbol's Value  Symbol's Name17# CHECK-NEXT: 0000000000000010  0000000200000000 R_X86_64_NONE 0000000011223344 static18# CHECK-NEXT: 0000000000000018  0000000100000000 R_X86_64_NONE 0000000088776655 both19 20!ELF21FileHeader:22  Class:   ELFCLASS6423  Data:    ELFDATA2LSB24  Type:    ET_DYN25  Machine: EM_X86_6426Sections:27  - Name: .data28    Type: SHT_PROGBITS29  - Name: .rela.dyn30    Type: [[TYPE=SHT_REL]]31    Link: .dynsym32    Info: .data33    Relocations:34      - Type: R_X86_64_NONE35        Symbol: dynamic36      - Offset: 837        Type: R_X86_64_NONE38        Symbol: both39  - Name: .rela.data40    Type: SHT_REL41    Link: .symtab42    Info: .data43    Relocations:44      - Offset: 1645        Type: R_X86_64_NONE46        Symbol: static47      - Offset: 2448        Type: R_X86_64_NONE49        Symbol: both50Symbols:51    - Name: both52      Section: .data53      Value: 0x8877665554      Binding: STB_GLOBAL55    - Name: static56      Section: .data57      Value: 0x1122334458      Binding: STB_GLOBAL59DynamicSymbols:60    - Name: dynamic61      Section: .data62      Value: 0x1234567863      Binding: STB_GLOBAL64    - Name: both65      Section: .data66      Value: 0x8765432167      Binding: STB_GLOBAL68