llvm.org GIT mirror llvm / c9830be
[llvm-readobj/llvm-readelf] - Simplify the elf-versioninfo.test test case. This removes 2 precompiled objects from the test case and replaces them with a single YAML. That allowed to simplify and clean up the test, remove excessive checks. Differential revision: https://reviews.llvm.org/D62529 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361932 91177308-0d34-0410-b5e6-96231b3b80d8 George Rimar 1 year, 3 days ago
3 changed file(s) with 173 addition(s) and 125 deletion(s). Raw diff Collapse all Expand all
test/tools/llvm-readobj/Inputs/verdef.elf-x86-64 less more
Binary diff not shown
test/tools/llvm-readobj/Inputs/verneed.elf-x86-64 less more
Binary diff not shown
None // Test that llvm-readobj dumps version info tags correctly.
0 ## Test that llvm-readobj dumps version info tags correctly.
11
2 RUN: llvm-readobj --dynamic-table -V %p/Inputs/verdef.elf-x86-64 | FileCheck %s --check-prefix=LLVM-VERDEF
3 RUN: llvm-readelf --dynamic-table -V %p/Inputs/verdef.elf-x86-64 | FileCheck %s --check-prefix=GNU-VERDEF
2 # RUN: yaml2obj %s --docnum=1 -o %t1
3 # RUN: llvm-readobj -V %t1 | FileCheck %s --check-prefix=LLVM
4 # RUN: llvm-readelf -V %t1 | FileCheck %s --check-prefix=GNU
45
5 LLVM-VERDEF: 0x000000006FFFFFF0 VERSYM 0x24C
6 LLVM-VERDEF: 0x000000006FFFFFFC VERDEF 0x25C
7 LLVM-VERDEF: 0x000000006FFFFFFD VERDEFNUM 3
6 --- !ELF
7 FileHeader:
8 Class: ELFCLASS64
9 Data: ELFDATA2LSB
10 OSABI: ELFOSABI_FREEBSD
11 Type: ET_DYN
12 Machine: EM_X86_64
13 Sections:
14 - Name: .gnu.version
15 Type: SHT_GNU_versym
16 Flags: [ SHF_ALLOC ]
17 Link: .dynsym
18 AddressAlign: 0x0000000000000002
19 EntSize: 0x0000000000000002
20 Entries: [ 0, 2, 3, 4, 5, 6]
21 - Name: .gnu.version_d
22 Type: SHT_GNU_verdef
23 Flags: [ SHF_ALLOC ]
24 Link: .dynstr
25 AddressAlign: 0x0000000000000004
26 Info: 0x0000000000000003
27 Entries:
28 - Version: 1
29 Flags: 0
30 VersionNdx: 2
31 Hash: 175630257
32 Names:
33 - VERSION1
34 - Version: 1
35 Flags: 0
36 VersionNdx: 3
37 Hash: 175630258
38 Names:
39 - VERSION2
40 - VERSION1
41 - Name: .gnu.version_r
42 Type: SHT_GNU_verneed
43 Flags: [ SHF_ALLOC ]
44 Link: .dynstr
45 AddressAlign: 0x0000000000000004
46 Info: 0x0000000000000002
47 Dependencies:
48 - Version: 1
49 File: verneed1.so.0
50 Entries:
51 - Name: v1
52 Hash: 1938
53 Flags: 0
54 Other: 4
55 - Name: v2
56 Hash: 1939
57 Flags: 0
58 Other: 5
59 - Version: 1
60 File: verneed2.so.0
61 Entries:
62 - Name: v3
63 Hash: 1937
64 Flags: 0
65 Other: 6
66 DynamicSymbols:
67 - Name: sym1
68 Binding: STB_GLOBAL
69 - Name: sym2
70 Binding: STB_GLOBAL
71 - Name: sym3
72 Binding: STB_GLOBAL
73 - Name: sym4
74 Binding: STB_GLOBAL
75 - Name: sym5
76 Binding: STB_GLOBAL
77 ...
878
9 LLVM-VERDEF: Version symbols {
10 LLVM-VERDEF-NEXT: Section Name: .gnu.version (20)
11 LLVM-VERDEF-NEXT: Address: 0x24C
12 LLVM-VERDEF-NEXT: Offset: 0x24C
13 LLVM-VERDEF-NEXT: Link: 1
14 LLVM-VERDEF-NEXT: Symbols [
15 LLVM-VERDEF-NEXT: Symbol {
16 LLVM-VERDEF-NEXT: Version: 0
17 LLVM-VERDEF-NEXT: Name: {{$}}
18 LLVM-VERDEF-NEXT: }
19 LLVM-VERDEF-NEXT: Symbol {
20 LLVM-VERDEF-NEXT: Version: 1
21 LLVM-VERDEF-NEXT: Name: _end{{$}}
22 LLVM-VERDEF-NEXT: }
23 LLVM-VERDEF-NEXT: Symbol {
24 LLVM-VERDEF-NEXT: Version: 1
25 LLVM-VERDEF-NEXT: Name: _edata{{$}}
26 LLVM-VERDEF-NEXT: }
27 LLVM-VERDEF-NEXT: Symbol {
28 LLVM-VERDEF-NEXT: Version: 3
29 LLVM-VERDEF-NEXT: Name: goo@@VERSION2
30 LLVM-VERDEF-NEXT: }
31 LLVM-VERDEF-NEXT: Symbol {
32 LLVM-VERDEF-NEXT: Version: 1
33 LLVM-VERDEF-NEXT: Name: __bss_start{{$}}
34 LLVM-VERDEF-NEXT: }
35 LLVM-VERDEF-NEXT: Symbol {
36 LLVM-VERDEF-NEXT: Version: 2
37 LLVM-VERDEF-NEXT: Name: foo@@VERSION1
38 LLVM-VERDEF-NEXT: }
39 LLVM-VERDEF-NEXT: Symbol {
40 LLVM-VERDEF-NEXT: Version: 2
41 LLVM-VERDEF-NEXT: Name: VERSION1@@VERSION1
42 LLVM-VERDEF-NEXT: }
43 LLVM-VERDEF-NEXT: Symbol {
44 LLVM-VERDEF-NEXT: Version: 3
45 LLVM-VERDEF-NEXT: Name: VERSION2@@VERSION2
46 LLVM-VERDEF-NEXT: }
47 LLVM-VERDEF-NEXT: ]
48 LLVM-VERDEF-NEXT: }
79 # LLVM: Version symbols {
80 # LLVM-NEXT: Section Name: .gnu.version
81 # LLVM-NEXT: Address: 0x0
82 # LLVM-NEXT: Offset: 0x280
83 # LLVM-NEXT: Link: 7
84 # LLVM-NEXT: Symbols [
85 # LLVM-NEXT: Symbol {
86 # LLVM-NEXT: Version: 0
87 # LLVM-NEXT: Name:
88 # LLVM-NEXT: }
89 # LLVM-NEXT: Symbol {
90 # LLVM-NEXT: Version: 2
91 # LLVM-NEXT: Name: sym1@@VERSION1
92 # LLVM-NEXT: }
93 # LLVM-NEXT: Symbol {
94 # LLVM-NEXT: Version: 3
95 # LLVM-NEXT: Name: sym2@@VERSION2
96 # LLVM-NEXT: }
97 # LLVM-NEXT: Symbol {
98 # LLVM-NEXT: Version: 4
99 # LLVM-NEXT: Name: sym3@v1
100 # LLVM-NEXT: }
101 # LLVM-NEXT: Symbol {
102 # LLVM-NEXT: Version: 5
103 # LLVM-NEXT: Name: sym4@v2
104 # LLVM-NEXT: }
105 # LLVM-NEXT: Symbol {
106 # LLVM-NEXT: Version: 6
107 # LLVM-NEXT: Name: sym5@v3
108 # LLVM-NEXT: }
109 # LLVM-NEXT: ]
110 # LLVM-NEXT: }
111 # LLVM-NEXT: SHT_GNU_verdef {
112 # LLVM-NEXT: Definition {
113 # LLVM-NEXT: Version: 1
114 # LLVM-NEXT: Flags: 0x0
115 # LLVM-NEXT: Index: 2
116 # LLVM-NEXT: Hash: 175630257
117 # LLVM-NEXT: Name: VERSION1
118 # LLVM-NEXT: }
119 # LLVM-NEXT: Definition {
120 # LLVM-NEXT: Version: 1
121 # LLVM-NEXT: Flags: 0x0
122 # LLVM-NEXT: Index: 3
123 # LLVM-NEXT: Hash: 175630258
124 # LLVM-NEXT: Name: VERSION2
125 # LLVM-NEXT: Predecessor: VERSION1
126 # LLVM-NEXT: }
127 # LLVM-NEXT: Definition {
128 # LLVM-NEXT: Version: 1
129 # LLVM-NEXT: Flags: 0x0
130 # LLVM-NEXT: Index: 3
131 # LLVM-NEXT: Hash: 175630258
132 # LLVM-NEXT: Name: VERSION2
133 # LLVM-NEXT: Predecessor: VERSION1
134 # LLVM-NEXT: }
135 # LLVM-NEXT: }
136 # LLVM-NEXT: SHT_GNU_verneed {
137 # LLVM-NEXT: Dependency {
138 # LLVM-NEXT: Version: 1
139 # LLVM-NEXT: Count: 2
140 # LLVM-NEXT: FileName: verneed1.so.0
141 # LLVM-NEXT: Entries [
142 # LLVM-NEXT: Entry {
143 # LLVM-NEXT: Hash: 1938
144 # LLVM-NEXT: Flags: 0x0
145 # LLVM-NEXT: Index: 4
146 # LLVM-NEXT: Name: v1
147 # LLVM-NEXT: }
148 # LLVM-NEXT: Entry {
149 # LLVM-NEXT: Hash: 1939
150 # LLVM-NEXT: Flags: 0x0
151 # LLVM-NEXT: Index: 5
152 # LLVM-NEXT: Name: v2
153 # LLVM-NEXT: }
154 # LLVM-NEXT: ]
155 # LLVM-NEXT: }
156 # LLVM-NEXT: Dependency {
157 # LLVM-NEXT: Version: 1
158 # LLVM-NEXT: Count: 1
159 # LLVM-NEXT: FileName: verneed2.so.0
160 # LLVM-NEXT: Entries [
161 # LLVM-NEXT: Entry {
162 # LLVM-NEXT: Hash: 1937
163 # LLVM-NEXT: Flags: 0x0
164 # LLVM-NEXT: Index: 6
165 # LLVM-NEXT: Name: v3
166 # LLVM-NEXT: }
167 # LLVM-NEXT: ]
168 # LLVM-NEXT: }
169 # LLVM-NEXT: }
49170
50 LLVM-VERDEF: SHT_GNU_verdef {
51 LLVM-VERDEF-NEXT: Definition {
52 LLVM-VERDEF-NEXT: Version: 1
53 LLVM-VERDEF-NEXT: Flags: Base (0x1)
54 LLVM-VERDEF-NEXT: Index: 1
55 LLVM-VERDEF-NEXT: Hash: 430712
56 LLVM-VERDEF-NEXT: Name: blah
57 LLVM-VERDEF-NEXT: }
58 LLVM-VERDEF-NEXT: Definition {
59 LLVM-VERDEF-NEXT: Version: 1
60 LLVM-VERDEF-NEXT: Flags: 0x0
61 LLVM-VERDEF-NEXT: Index: 2
62 LLVM-VERDEF-NEXT: Hash: 175630257
63 LLVM-VERDEF-NEXT: Name: VERSION1
64 LLVM-VERDEF-NEXT: }
65 LLVM-VERDEF-NEXT: Definition {
66 LLVM-VERDEF-NEXT: Version: 1
67 LLVM-VERDEF-NEXT: Flags: 0x0
68 LLVM-VERDEF-NEXT: Index: 3
69 LLVM-VERDEF-NEXT: Hash: 175630258
70 LLVM-VERDEF-NEXT: Name: VERSION2
71 LLVM-VERDEF-NEXT: Predecessor: VERSION1
72 LLVM-VERDEF-NEXT: }
73 LLVM-VERDEF-NEXT: }
171 # GNU: Version symbols section '.gnu.version' contains 6 entries:
172 # GNU-NEXT: Addr: 0000000000000000 Offset: 0x000280 Link: 7 (.dynsym)
173 # GNU-NEXT: 000: 0 (*local*) 2 (VERSION1) 3 (VERSION2) 4 (v1)
174 # GNU-NEXT: 004: 5 (v2) 6 (v3)
74175
75 GNU-VERDEF: 0x000000006ffffff0 (VERSYM) 0x24c
76 GNU-VERDEF: 0x000000006ffffffc (VERDEF) 0x25c
77 GNU-VERDEF: 0x000000006ffffffd (VERDEFNUM) 3
78
79 GNU-VERDEF: Version symbols section '.gnu.version' contains 8 entries:
80 GNU-VERDEF-NEXT: Addr: 000000000000024c Offset: 0x00024c Link: 1 (.dynsym)
81 GNU-VERDEF-NEXT: 000: 0 (*local*) 1 (*global*) 1 (*global*) 3 (VERSION2)
82 GNU-VERDEF-NEXT: 004: 1 (*global*) 2 (VERSION1) 2 (VERSION1) 3 (VERSION2)
83
84 GNU-VERDEF: Dumper for .gnu.version_d is not implemented
85
86 RUN: llvm-readobj -V %p/Inputs/verneed.elf-x86-64 | FileCheck %s --check-prefix=LLVM-VERNEED
87 RUN: llvm-readelf -V %p/Inputs/verneed.elf-x86-64 | FileCheck %s --check-prefix=GNU-VERNEED
88
89 LLVM-VERNEED: SHT_GNU_verneed {
90 LLVM-VERNEED-NEXT: Dependency {
91 LLVM-VERNEED-NEXT: Version: 1
92 LLVM-VERNEED-NEXT: Count: 2
93 LLVM-VERNEED-NEXT: FileName: verneed1.so.0
94 LLVM-VERNEED-NEXT: Entries [
95 LLVM-VERNEED-NEXT: Entry {
96 LLVM-VERNEED-NEXT: Hash: 1938
97 LLVM-VERNEED-NEXT: Flags: 0x0
98 LLVM-VERNEED-NEXT: Index: 3
99 LLVM-VERNEED-NEXT: Name: v2
100 LLVM-VERNEED-NEXT: }
101 LLVM-VERNEED-NEXT: Entry {
102 LLVM-VERNEED-NEXT: Hash: 1939
103 LLVM-VERNEED-NEXT: Flags: 0x0
104 LLVM-VERNEED-NEXT: Index: 2
105 LLVM-VERNEED-NEXT: Name: v3
106 LLVM-VERNEED-NEXT: }
107 LLVM-VERNEED-NEXT: ]
108 LLVM-VERNEED-NEXT: }
109 LLVM-VERNEED-NEXT: Dependency {
110 LLVM-VERNEED-NEXT: Version: 1
111 LLVM-VERNEED-NEXT: Count: 1
112 LLVM-VERNEED-NEXT: FileName: verneed2.so.0
113 LLVM-VERNEED-NEXT: Entries [
114 LLVM-VERNEED-NEXT: Entry {
115 LLVM-VERNEED-NEXT: Hash: 1937
116 LLVM-VERNEED-NEXT: Flags: 0x0
117 LLVM-VERNEED-NEXT: Index: 4
118 LLVM-VERNEED-NEXT: Name: v1
119 LLVM-VERNEED-NEXT: }
120 LLVM-VERNEED-NEXT: ]
121 LLVM-VERNEED-NEXT: }
122 LLVM-VERNEED-NEXT: }
123
124 GNU-VERNEED: Version symbols section '.gnu.version' contains 4 entries:
125 GNU-VERNEED-NEXT: Addr: 0000000000010228 Offset: 0x000228 Link: 1 (.dynsym)
126 GNU-VERNEED-NEXT: 000: 0 (*local*) 2 (v3) 3 (v2) 4 (v1)
127
128 GNU-VERNEED: Dumper for .gnu.version_r is not implemented
129
176 # GNU-VERDEF: Dumper for .gnu.version_d is not implemented
177 # GNU-VERNEED: Dumper for .gnu.version_r is not implemented