3 # RUN: echo ".globl foo; .data; .dc.a foo" > %te.s
4 # RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %te.s -o %te-i386.o
5 # RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %s -o %t-i386.o
6 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t-x86_64.o
7 # RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t-ppc64le.o
8 # RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t-ppc64.o
10 # RUN: echo ".global zed; zed:" > %t2.s
11 # RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %t2.s -o %t2-i386.o
12 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t2.s -o %t2-x86_64.o
13 # RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %t2.s -o %t2-ppc64le.o
14 # RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %t2.s -o %t2-ppc64.o
16 # RUN: rm -f %t2-i386.a %t2-x86_64.a %t2-ppc64.a %t2-ppc64le.a
17 # RUN: llvm-ar rc %t2-i386.a %t2-i386.o
18 # RUN: llvm-ar rc %t2-x86_64.a %t2-x86_64.o
19 # RUN: llvm-ar rc %t2-ppc64le.a %t2-ppc64le.o
20 # RUN: llvm-ar rc %t2-ppc64.a %t2-ppc64.o
22 # RUN: echo ".global xyz; xyz:" > %t3.s
23 # RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %t3.s -o %t3-i386.o
24 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t3.s -o %t3-x86_64.o
25 # RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %t3.s -o %t3-ppc64le.o
26 # RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %t3.s -o %t3-ppc64.o
28 # RUN: ld.lld -shared %t3-i386.o -o %t3-i386.so
29 # RUN: ld.lld -shared %t3-x86_64.o -o %t3-x86_64.so
30 # RUN: ld.lld -shared %t3-ppc64le.o -o %t3-ppc64le.so
31 # RUN: ld.lld -shared %t3-ppc64.o -o %t3-ppc64.so
33 # RUN: ld.lld -shared --hash-style=gnu -o %te-i386.so %te-i386.o
34 # RUN: ld.lld -shared -hash-style=gnu -o %t-i386.so %t-i386.o %t2-i386.a %t3-i386.so
35 # RUN: ld.lld -shared -hash-style=gnu -o %t-x86_64.so %t-x86_64.o %t2-x86_64.a %t3-x86_64.so
36 # RUN: ld.lld -shared --hash-style both -o %t-ppc64le.so %t-ppc64le.o %t2-ppc64le.a %t3-ppc64le.so
37 # RUN: ld.lld -shared --hash-style both -o %t-ppc64.so %t-ppc64.o %t2-ppc64.a %t3-ppc64.so
39 # RUN: llvm-readobj --dyn-syms --gnu-hash-table %te-i386.so \
40 # RUN: | FileCheck %s -check-prefix=EMPTY
41 # RUN: llvm-readobj --sections --dyn-syms --gnu-hash-table %t-i386.so \
42 # RUN: | FileCheck %s -check-prefix=I386
43 # RUN: llvm-readobj --sections --dyn-syms --gnu-hash-table %t-x86_64.so \
44 # RUN: | FileCheck %s -check-prefix=X86_64
45 # RUN: llvm-readobj --sections --dyn-syms --gnu-hash-table %t-ppc64le.so \
46 # RUN: | FileCheck %s -check-prefix=PPC64
47 # RUN: llvm-readobj --sections --dyn-syms --gnu-hash-table %t-ppc64.so \
48 # RUN: | FileCheck %s -check-prefix=PPC64
50 # EMPTY: DynamicSymbols [
53 # EMPTY-NEXT: Value: 0x0
55 # EMPTY-NEXT: Binding: Global
56 # EMPTY-NEXT: Type: None
57 # EMPTY-NEXT: Other: 0
58 # EMPTY-NEXT: Section: Undefined
61 # EMPTY: GnuHashTable {
62 # EMPTY-NEXT: Num Buckets: 1
63 # EMPTY-NEXT: First Hashed Symbol Index: 2
64 # EMPTY-NEXT: Num Mask Words: 1
65 # EMPTY-NEXT: Shift Count: 26
66 # EMPTY-NEXT: Bloom Filter: [0x0]
67 # EMPTY-NEXT: Buckets: [0]
68 # EMPTY-NEXT: Values: []
71 # I386: Format: elf32-i386
73 # I386: AddressSize: 32bit
75 # I386: Name: .gnu.hash
76 # I386-NEXT: Type: SHT_GNU_HASH
78 # I386-NEXT: SHF_ALLOC
85 # I386-NEXT: AddressAlignment: 4
86 # I386-NEXT: EntrySize: 0
88 # I386: DynamicSymbols [
91 # I386: Binding: Local
92 # I386: Section: Undefined
96 # I386: Binding: Global
97 # I386: Section: Undefined
101 # I386: Binding: Global
102 # I386: Section: Undefined
106 # I386: Binding: Weak
107 # I386: Section: Undefined
111 # I386: Binding: Global
112 # I386: Section: .text
116 # I386: Binding: Global
117 # I386: Section: .text
120 # I386: GnuHashTable {
121 # I386-NEXT: Num Buckets: 1
122 # I386-NEXT: First Hashed Symbol Index: 4
123 # I386-NEXT: Num Mask Words: 1
124 # I386-NEXT: Shift Count: 26
125 # I386-NEXT: Bloom Filter: [0x4000204]
126 # I386-NEXT: Buckets: [4]
127 # I386-NEXT: Values: [0xB8860BA, 0xB887389]
130 # X86_64: Format: elf64-x86-64
131 # X86_64: Arch: x86_64
132 # X86_64: AddressSize: 64bit
134 # X86_64: Name: .gnu.hash
135 # X86_64-NEXT: Type: SHT_GNU_HASH
136 # X86_64-NEXT: Flags [
137 # X86_64-NEXT: SHF_ALLOC
139 # X86_64-NEXT: Address:
140 # X86_64-NEXT: Offset:
141 # X86_64-NEXT: Size: 36
143 # X86_64-NEXT: Info: 0
144 # X86_64-NEXT: AddressAlignment: 8
145 # X86_64-NEXT: EntrySize: 0
148 # X86_64: DynamicSymbols [
151 # X86_64: Binding: Local
152 # X86_64: Section: Undefined
156 # X86_64: Binding: Global
157 # X86_64: Section: Undefined
161 # X86_64: Binding: Global
162 # X86_64: Section: Undefined
166 # X86_64: Binding: Weak
167 # X86_64: Section: Undefined
171 # X86_64: Binding: Global
172 # X86_64: Section: .text
176 # X86_64: Binding: Global
177 # X86_64: Section: .text
180 # X86_64: GnuHashTable {
181 # X86_64-NEXT: Num Buckets: 1
182 # X86_64-NEXT: First Hashed Symbol Index: 4
183 # X86_64-NEXT: Num Mask Words: 1
184 # X86_64-NEXT: Shift Count: 26
185 # X86_64-NEXT: Bloom Filter: [0x400000000000204]
186 # X86_64-NEXT: Buckets: [4]
187 # X86_64-NEXT: Values: [0xB8860BA, 0xB887389]
190 # PPC64: Format: elf64-powerpc
191 # PPC64: Arch: powerpc64
192 # PPC64: AddressSize: 64bit
194 # PPC64: Name: .gnu.hash
195 # PPC64-NEXT: Type: SHT_GNU_HASH
196 # PPC64-NEXT: Flags [
197 # PPC64-NEXT: SHF_ALLOC
199 # PPC64-NEXT: Address:
200 # PPC64-NEXT: Offset:
201 # PPC64-NEXT: Size: 36
203 # PPC64-NEXT: Info: 0
204 # PPC64-NEXT: AddressAlignment: 8
205 # PPC64-NEXT: EntrySize: 0
208 # PPC64: DynamicSymbols [
211 # PPC64: Binding: Local
212 # PPC64: Section: Undefined
216 # PPC64: Binding: Global
217 # PPC64: Section: Undefined
221 # PPC64: Binding: Global
222 # PPC64: Section: Undefined
226 # PPC64: Binding: Weak
227 # PPC64: Section: Undefined
231 # PPC64: Binding: Global
232 # PPC64: Section: .text
236 # PPC64: Binding: Global
237 # PPC64: Section: .text
240 # PPC64: GnuHashTable {
241 # PPC64-NEXT: Num Buckets: 1
242 # PPC64-NEXT: First Hashed Symbol Index: 4
243 # PPC64-NEXT: Num Mask Words: 1
244 # PPC64-NEXT: Shift Count: 26
245 # PPC64-NEXT: Bloom Filter: [0x400000000000204]
246 # PPC64-NEXT: Buckets: [4]
247 # PPC64-NEXT: Values: [0xB8860BA, 0xB887389]