1// Test that llvm-readobj dumps version info tags correctly.
2
3RUN: llvm-readobj -dynamic-table -V %p/Inputs/verdef.elf-x86-64 | FileCheck %s
4
5CHECK: 0x000000006FFFFFF0 VERSYM               0x24C
6CHECK: 0x000000006FFFFFFC VERDEF               0x25C
7CHECK: 0x000000006FFFFFFD VERDEFNUM            3
8
9CHECK: Version symbols {
10CHECK-NEXT:   Section Name: .gnu.version (20)
11CHECK-NEXT:   Address: 0x24C
12CHECK-NEXT:   Offset: 0x24C
13CHECK-NEXT:   Link: 1
14CHECK-NEXT:   Symbols [
15CHECK-NEXT:     Symbol {
16CHECK-NEXT:       Version: 0
17CHECK-NEXT:       Name: @
18CHECK-NEXT:     }
19CHECK-NEXT:     Symbol {
20CHECK-NEXT:       Version: 1
21CHECK-NEXT:       Name: _end@
22CHECK-NEXT:     }
23CHECK-NEXT:     Symbol {
24CHECK-NEXT:       Version: 1
25CHECK-NEXT:       Name: _edata@
26CHECK-NEXT:     }
27CHECK-NEXT:     Symbol {
28CHECK-NEXT:       Version: 3
29CHECK-NEXT:       Name: goo@@VERSION2
30CHECK-NEXT:     }
31CHECK-NEXT:     Symbol {
32CHECK-NEXT:       Version: 1
33CHECK-NEXT:       Name: __bss_start@
34CHECK-NEXT:     }
35CHECK-NEXT:     Symbol {
36CHECK-NEXT:       Version: 2
37CHECK-NEXT:       Name: foo@@VERSION1
38CHECK-NEXT:     }
39CHECK-NEXT:     Symbol {
40CHECK-NEXT:       Version: 2
41CHECK-NEXT:       Name: VERSION1@@VERSION1
42CHECK-NEXT:     }
43CHECK-NEXT:     Symbol {
44CHECK-NEXT:       Version: 3
45CHECK-NEXT:       Name: VERSION2@@VERSION2
46CHECK-NEXT:     }
47CHECK-NEXT:   ]
48CHECK-NEXT: }
49
50CHECK:      SHT_GNU_verdef {
51CHECK-NEXT:   Definition {
52CHECK-NEXT:     Version: 1
53CHECK-NEXT:     Flags: Base (0x1)
54CHECK-NEXT:     Index: 1
55CHECK-NEXT:     Hash: 430712
56CHECK-NEXT:     Name: blah
57CHECK-NEXT:   }
58CHECK-NEXT:   Definition {
59CHECK-NEXT:     Version: 1
60CHECK-NEXT:     Flags: 0x0
61CHECK-NEXT:     Index: 2
62CHECK-NEXT:     Hash: 175630257
63CHECK-NEXT:     Name: VERSION1
64CHECK-NEXT:   }
65CHECK-NEXT:   Definition {
66CHECK-NEXT:     Version: 1
67CHECK-NEXT:     Flags: 0x0
68CHECK-NEXT:     Index: 3
69CHECK-NEXT:     Hash: 175630258
70CHECK-NEXT:     Name: VERSION2
71CHECK-NEXT:     Predecessor: VERSION1
72CHECK-NEXT:   }
73CHECK-NEXT: }
74
75RUN: llvm-readobj -V %p/Inputs/verneed.elf-x86-64 | FileCheck %s --check-prefix=VERNEED
76
77VERNEED:       SHT_GNU_verneed {
78VERNEED-NEXT:   Dependency {
79VERNEED-NEXT:     Version: 1
80VERNEED-NEXT:     Count: 2
81VERNEED-NEXT:     FileName: verneed1.so.0
82VERNEED-NEXT:     Entry {
83VERNEED-NEXT:       Hash: 1938
84VERNEED-NEXT:       Flags: 0x0
85VERNEED-NEXT:       Index: 3
86VERNEED-NEXT:       Name: v2
87VERNEED-NEXT:     }
88VERNEED-NEXT:     Entry {
89VERNEED-NEXT:       Hash: 1939
90VERNEED-NEXT:       Flags: 0x0
91VERNEED-NEXT:       Index: 2
92VERNEED-NEXT:       Name: v3
93VERNEED-NEXT:     }
94VERNEED-NEXT:   }
95VERNEED-NEXT:   Dependency {
96VERNEED-NEXT:     Version: 1
97VERNEED-NEXT:     Count: 1
98VERNEED-NEXT:     FileName: verneed2.so.0
99VERNEED-NEXT:     Entry {
100VERNEED-NEXT:       Hash: 1937
101VERNEED-NEXT:       Flags: 0x0
102VERNEED-NEXT:       Index: 4
103VERNEED-NEXT:       Name: v1
104VERNEED-NEXT:     }
105VERNEED-NEXT:   }
106VERNEED-NEXT: }
107