Recommit r371023 "[lib/ObjectYAML] - Stop calling error(1) when mapping the st_other...
[llvm-complete.git] / test / tools / yaml2obj / dynamic-relocations.yaml
blob2e2d3801f636bf6b50e1b6bbeaa6d987811c89b1
1 ## Show that yaml2obj uses the correct set of symbols for relocation sections
2 ## referencing the dynamic symbol table.
4 # RUN: yaml2obj %s -o %t
5 # RUN: llvm-readelf -r %t | FileCheck %s
7 # CHECK:      Relocation section '.rela.dyn' at offset {{.*}} contains 2 entries:
8 # CHECK-NEXT:     Offset             Info             Type      Symbol's Value  Symbol's Name
9 # CHECK-NEXT: 0000000000000000  0000000100000000 R_X86_64_NONE 0000000012345678 dynamic
10 # CHECK-NEXT: 0000000000000008  0000000200000000 R_X86_64_NONE 0000000087654321 both
11 # CHECK-EMPTY:
12 # CHECK-NEXT: Relocation section '.rela.data' at offset {{.*}} contains 2 entries:
13 # CHECK-NEXT:     Offset             Info             Type      Symbol's Value  Symbol's Name
14 # CHECK-NEXT: 0000000000000010  0000000200000000 R_X86_64_NONE 0000000011223344 static
15 # CHECK-NEXT: 0000000000000018  0000000100000000 R_X86_64_NONE 0000000088776655 both
17 !ELF
18 FileHeader:
19   Class:   ELFCLASS64
20   Data:    ELFDATA2LSB
21   Type:    ET_DYN
22   Machine: EM_X86_64
23 Sections:
24   - Name: .data
25     Type: SHT_PROGBITS
26   - Name: .rela.dyn
27     Type: SHT_REL
28     Link: .dynsym
29     Info: .data
30     Relocations:
31       - Offset: 0
32         Type: R_X86_64_NONE
33         Symbol: dynamic
34       - Offset: 8
35         Type: R_X86_64_NONE
36         Symbol: both
37   - Name: .rela.data
38     Type: SHT_REL
39     Link: .symtab
40     Info: .data
41     Relocations:
42       - Offset: 16
43         Type: R_X86_64_NONE
44         Symbol: static
45       - Offset: 24
46         Type: R_X86_64_NONE
47         Symbol: both
48 Symbols:
49     - Name: both
50       Section: .data
51       Value: 0x88776655
52       Binding: STB_GLOBAL
53     - Name: static
54       Section: .data
55       Value: 0x11223344
56       Binding: STB_GLOBAL
57 DynamicSymbols:
58     - Name: dynamic
59       Section: .data
60       Value: 0x12345678
61       Binding: STB_GLOBAL
62     - Name: both
63       Section: .data
64       Value: 0x87654321
65       Binding: STB_GLOBAL