1 ## Check how llvm-readobj/llvm-readelf tools dump the flags of SHT_GNU_verneed
4 # RUN: yaml2obj %s -o %t
5 # RUN: llvm-readobj -V %t | FileCheck %s --check-prefix=LLVM-VERDEF
6 # RUN: llvm-readelf -V %t | FileCheck %s --check-prefix=GNU-VERDEF
8 # LLVM-VERDEF: VersionRequirements [
9 # LLVM-VERDEF-NEXT: Dependency {
10 # LLVM-VERDEF-NEXT: Version: 1
11 # LLVM-VERDEF-NEXT: Count: 6
12 # LLVM-VERDEF-NEXT: FileName: dso.so.0
13 # LLVM-VERDEF-NEXT: Entries [
14 # LLVM-VERDEF-NEXT: Entry {
15 # LLVM-VERDEF-NEXT: Hash: 0
16 # LLVM-VERDEF-NEXT: Flags [ (0x1)
17 # LLVM-VERDEF-NEXT: Base (0x1)
19 # LLVM-VERDEF-NEXT: Index: 0
20 # LLVM-VERDEF-NEXT: Name: base
22 # LLVM-VERDEF-NEXT: Entry {
23 # LLVM-VERDEF-NEXT: Hash: 0
24 # LLVM-VERDEF-NEXT: Flags [ (0x2)
25 # LLVM-VERDEF-NEXT: Weak (0x2)
27 # LLVM-VERDEF-NEXT: Index: 0
28 # LLVM-VERDEF-NEXT: Name: weak
30 # LLVM-VERDEF-NEXT: Entry {
31 # LLVM-VERDEF-NEXT: Hash: 0
32 # LLVM-VERDEF-NEXT: Flags [ (0x4)
33 # LLVM-VERDEF-NEXT: Info (0x4)
35 # LLVM-VERDEF-NEXT: Index: 0
36 # LLVM-VERDEF-NEXT: Name: info
38 # LLVM-VERDEF-NEXT: Entry {
39 # LLVM-VERDEF-NEXT: Hash: 0
40 # LLVM-VERDEF-NEXT: Flags [ (0x7)
41 # LLVM-VERDEF-NEXT: Base (0x1)
42 # LLVM-VERDEF-NEXT: Info (0x4)
43 # LLVM-VERDEF-NEXT: Weak (0x2)
45 # LLVM-VERDEF-NEXT: Index: 0
46 # LLVM-VERDEF-NEXT: Name: all
48 # LLVM-VERDEF-NEXT: Entry {
49 # LLVM-VERDEF-NEXT: Hash: 0
50 # LLVM-VERDEF-NEXT: Flags [ (0x8)
52 # LLVM-VERDEF-NEXT: Index: 0
53 # LLVM-VERDEF-NEXT: Name: unknown
55 # LLVM-VERDEF-NEXT: Entry {
56 # LLVM-VERDEF-NEXT: Hash: 0
57 # LLVM-VERDEF-NEXT: Flags [ (0xF)
58 # LLVM-VERDEF-NEXT: Base (0x1)
59 # LLVM-VERDEF-NEXT: Info (0x4)
60 # LLVM-VERDEF-NEXT: Weak (0x2)
62 # LLVM-VERDEF-NEXT: Index: 0
63 # LLVM-VERDEF-NEXT: Name: all_and_unknown
69 # GNU-VERDEF: Version needs section '.gnu.version_r' contains 1 entries:
70 # GNU-VERDEF-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 3 (.dynstr)
71 # GNU-VERDEF-NEXT: 0x0000: Version: 1 File: dso.so.0 Cnt: 6
72 # GNU-VERDEF-NEXT: 0x0010: Name: base Flags: BASE Version: 0
73 # GNU-VERDEF-NEXT: 0x0020: Name: weak Flags: WEAK Version: 0
74 # GNU-VERDEF-NEXT: 0x0030: Name: info Flags: INFO Version: 0
75 # GNU-VERDEF-NEXT: 0x0040: Name: all Flags: BASE | WEAK | INFO Version: 0
76 # GNU-VERDEF-NEXT: 0x0050: Name: unknown Flags: <unknown> Version: 0
77 # GNU-VERDEF-NEXT: 0x0060: Name: all_and_unknown Flags: BASE | WEAK | INFO | <unknown> Version: 0
84 Entry: 0x0000000000201000
86 - Name: .gnu.version_r
112 - Name: all_and_unknown
116 ## Needed to trigger .dynstr creation, which is required by .gnu.version_r