[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / tools / llvm-readobj / elf-reloc-zero-name-or-value.test
blobc6481badc14c1374d2f7f679b0bc4a65e911674f
1 # Show that the value field is omitted if a symbol has no name or value, but is
2 # printed if one is present. Test for both static and dynamic relocation
3 # printing.
5 # RUN: yaml2obj %s -o %t
6 # RUN: llvm-readelf --relocations --dyn-relocations %t | FileCheck %s
8 # CHECK:      Relocation section '.rela.text' at offset {{.*}} contains 3 entries:
9 # CHECK-NEXT:     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
10 # CHECK-NEXT: 0000000000000000  0000000000000000 R_X86_64_NONE                           1
11 # CHECK-NEXT: 0000000000000000  0000000100000000 R_X86_64_NONE          0000000000000000 sym + 1
12 # CHECK-NEXT: 0000000000000000  0000000200000000 R_X86_64_NONE          0000000000000123 456
14 # CHECK:      Relocation section '.rela.dyn' at offset {{.*}} contains 3 entries:
15 # CHECK-NEXT:     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
16 # CHECK-NEXT: 0000000000000000  0000000000000000 R_X86_64_NONE                           1
17 # CHECK-NEXT: 0000000000000000  0000000100000000 R_X86_64_NONE          0000000000000000 sym + 1
18 # CHECK-NEXT: 0000000000000000  0000000200000000 R_X86_64_NONE          0000000000000123 456
20 # CHECK:      'RELA' relocation section at offset {{.*}} contains 72 bytes:
21 # CHECK-NEXT:     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
22 # CHECK-NEXT: 0000000000000000  0000000000000000 R_X86_64_NONE                           1
23 # CHECK-NEXT: 0000000000000000  0000000100000000 R_X86_64_NONE          0000000000000000 sym + 1
24 # CHECK-NEXT: 0000000000000000  0000000200000000 R_X86_64_NONE          0000000000000123 456
26 --- !ELF
27 FileHeader:
28   Class:   ELFCLASS64
29   Data:    ELFDATA2LSB
30   Type:    ET_EXEC
31   Machine: EM_X86_64
32 Sections:
33   - Name: .text
34     Type: SHT_PROGBITS
35     Size: 0x10
36   - Name: .rela.text
37     Type: SHT_RELA
38     Link: .symtab
39     Info: .text
40     Relocations:
41       - Offset: 0
42         Type: R_X86_64_NONE
43         Addend: 1
44       - Offset: 0
45         Type: R_X86_64_NONE
46         Addend: 1
47         Symbol: sym
48       - Offset: 0
49         Type: R_X86_64_NONE
50         Addend: 0x456
51         Symbol: 2
52   - Name: .dynamic
53     Type: SHT_DYNAMIC
54     Flags: [SHF_ALLOC]
55     Address: 0x1000
56     AddressAlign: 0x1000
57     Entries:
58       - Tag: DT_RELA
59         Value: 0x1100
60       - Tag: DT_RELASZ
61         Value: 72
62       - Tag: DT_RELAENT
63         Value: 24
64       - Tag: DT_NULL
65         Value: 0
66   - Name: .rela.dyn
67     Type: SHT_RELA
68     Flags: [SHF_ALLOC]
69     Info: .text
70     Address: 0x1100
71     AddressAlign: 0x100
72     Relocations:
73       - Offset: 0
74         Type: R_X86_64_NONE
75         Addend: 1
76       - Offset: 0
77         Type: R_X86_64_NONE
78         Addend: 1
79         Symbol: sym
80       - Offset: 0
81         Type: R_X86_64_NONE
82         Addend: 0x456
83         Symbol: 2
84 Symbols:
85   - Name:    sym
86     Value:   0
87     Section: .text
88     Binding: STB_GLOBAL
89   - Value:   0x123
90     Section: .text
91     Binding: STB_GLOBAL
92 DynamicSymbols:
93   - Name:    sym
94     Value:   0
95     Section: .text
96     Binding: STB_GLOBAL
97   - Value:   0x123
98     Section: .text
99     Binding: STB_GLOBAL
100 ProgramHeaders:
101   - Type: PT_LOAD
102     VAddr: 0x1000
103     Sections:
104       - Section: .rela.dyn
105       - Section: .dynamic
106   - Type: PT_DYNAMIC
107     VAddr: 0x1000
108     Sections:
109       - Section: .dynamic