1// Check dumping of the GNU Hash section
2// The input was generated using the following:
3// $ llvm-mc -filetype=obj -triple=i386-pc-linux      -o example-i386.o   example.s
4// $ llvm-mc -filetype=obj -triple=x86_64-pc-linux    -o example-x86_64.o example.s
5// $ llvm-mc -filetype=obj -triple=powerpc-pc-linux   -o example-ppc.o    example.s
6// $ llvm-mc -filetype=obj -triple=powerpc64-pc-linux -o example-ppc64.o  example.s
7// $ ld -shared -m elf_i386   -hash-style=gnu -o gnuhash.so.elf-i386   example-i386.o
8// $ ld -shared -m elf_x86_64 -hash-style=gnu -o gnuhash.so.elf-x86_64 example-x86_64.o
9// $ ld -shared -m elf32ppc   -hash-style=gnu -o gnuhash.so.elf-ppc    example-ppc.o
10// $ ld -shared -m elf64ppc   -hash-style=gnu -o gnuhash.so.elf-ppc64  example-ppc64.o
11// $ cat example.s
12// .globl foo
13// foo:
14
15RUN: llvm-readobj -gnu-hash-table %p/Inputs/gnuhash.so.elf-i386   | FileCheck %s -check-prefix I386
16RUN: llvm-readobj -gnu-hash-table %p/Inputs/gnuhash.so.elf-x86_64 | FileCheck %s -check-prefix X86_64
17RUN: llvm-readobj -gnu-hash-table %p/Inputs/gnuhash.so.elf-ppc    | FileCheck %s -check-prefix PPC
18RUN: llvm-readobj -gnu-hash-table %p/Inputs/gnuhash.so.elf-ppc64  | FileCheck %s -check-prefix PPC64
19
20I386:      Arch: i386
21I386:      GnuHashTable {
22I386-NEXT:   Num Buckets: 3
23I386-NEXT:   First Hashed Symbol Index: 1
24I386-NEXT:   Num Mask Words: 1
25I386-NEXT:   Shift Count: 5
26I386-NEXT:   Bloom Filter: [0x39004608]
27I386-NEXT:   Buckets: [1, 4, 0]
28I386-NEXT:   Values: [0xB887388, 0xECD54542, 0x7C92E3BB, 0x1C5871D9]
29I386-NEXT: }
30
31X86_64:      Arch: x86_64
32X86_64:      GnuHashTable {
33X86_64-NEXT:   Num Buckets: 3
34X86_64-NEXT:   First Hashed Symbol Index: 1
35X86_64-NEXT:   Num Mask Words: 1
36X86_64-NEXT:   Shift Count: 6
37X86_64-NEXT:   Bloom Filter: [0x800000001204288]
38X86_64-NEXT:   Buckets: [1, 4, 0]
39X86_64-NEXT:   Values: [0xB887388, 0xECD54542, 0x7C92E3BB, 0x1C5871D9]
40X86_64-NEXT: }
41
42PPC:      Arch: powerpc
43PPC:      GnuHashTable {
44PPC-NEXT:   Num Buckets: 3
45PPC-NEXT:   First Hashed Symbol Index: 1
46PPC-NEXT:   Num Mask Words: 1
47PPC-NEXT:   Shift Count: 5
48PPC-NEXT:   Bloom Filter: [0x3D00460A]
49PPC-NEXT:   Buckets: [1, 5, 0]
50PPC-NEXT:   Values: [0xEEBEC3A, 0xB887388, 0xECD54542, 0x7C92E3BB, 0x1C5871D9]
51PPC-NEXT: }
52
53PPC64:      Arch: powerpc64
54PPC64:      GnuHashTable {
55PPC64-NEXT:   Num Buckets: 3
56PPC64-NEXT:   First Hashed Symbol Index: 1
57PPC64-NEXT:   Num Mask Words: 1
58PPC64-NEXT:   Shift Count: 6
59PPC64-NEXT:   Bloom Filter: [0x800000001204288]
60PPC64-NEXT:   Buckets: [1, 4, 0]
61PPC64-NEXT:   Values: [0xB887388, 0xECD54542, 0x7C92E3BB, 0x1C5871D9]
62PPC64-NEXT: }
63
64