llvm-project/llvm/test/tools/llvm-readobj/elf-gnuhash.test

64 lines
2.5 KiB
Plaintext

// Check dumping of the GNU Hash section
// The input was generated using the following:
// $ llvm-mc -filetype=obj -triple=i386-pc-linux -o example-i386.o example.s
// $ llvm-mc -filetype=obj -triple=x86_64-pc-linux -o example-x86_64.o example.s
// $ llvm-mc -filetype=obj -triple=powerpc-pc-linux -o example-ppc.o example.s
// $ llvm-mc -filetype=obj -triple=powerpc64-pc-linux -o example-ppc64.o example.s
// $ ld -shared -m elf_i386 -hash-style=gnu -o gnuhash.so.elf-i386 example-i386.o
// $ ld -shared -m elf_x86_64 -hash-style=gnu -o gnuhash.so.elf-x86_64 example-x86_64.o
// $ ld -shared -m elf32ppc -hash-style=gnu -o gnuhash.so.elf-ppc example-ppc.o
// $ ld -shared -m elf64ppc -hash-style=gnu -o gnuhash.so.elf-ppc64 example-ppc64.o
// $ cat example.s
// .globl foo
// foo:
RUN: llvm-readobj -gnu-hash-table %p/Inputs/gnuhash.so.elf-i386 | FileCheck %s -check-prefix I386
RUN: llvm-readobj -gnu-hash-table %p/Inputs/gnuhash.so.elf-x86_64 | FileCheck %s -check-prefix X86_64
RUN: llvm-readobj -gnu-hash-table %p/Inputs/gnuhash.so.elf-ppc | FileCheck %s -check-prefix PPC
RUN: llvm-readobj -gnu-hash-table %p/Inputs/gnuhash.so.elf-ppc64 | FileCheck %s -check-prefix PPC64
I386: Arch: i386
I386: GnuHashTable {
I386-NEXT: Num Buckets: 3
I386-NEXT: First Hashed Symbol Index: 1
I386-NEXT: Num Mask Words: 1
I386-NEXT: Shift Count: 5
I386-NEXT: Bloom Filter: [0x39004608]
I386-NEXT: Buckets: [1, 4, 0]
I386-NEXT: Values: [0xB887388, 0xECD54542, 0x7C92E3BB, 0x1C5871D9]
I386-NEXT: }
X86_64: Arch: x86_64
X86_64: GnuHashTable {
X86_64-NEXT: Num Buckets: 3
X86_64-NEXT: First Hashed Symbol Index: 1
X86_64-NEXT: Num Mask Words: 1
X86_64-NEXT: Shift Count: 6
X86_64-NEXT: Bloom Filter: [0x800000001204288]
X86_64-NEXT: Buckets: [1, 4, 0]
X86_64-NEXT: Values: [0xB887388, 0xECD54542, 0x7C92E3BB, 0x1C5871D9]
X86_64-NEXT: }
PPC: Arch: powerpc
PPC: GnuHashTable {
PPC-NEXT: Num Buckets: 3
PPC-NEXT: First Hashed Symbol Index: 1
PPC-NEXT: Num Mask Words: 1
PPC-NEXT: Shift Count: 5
PPC-NEXT: Bloom Filter: [0x3D00460A]
PPC-NEXT: Buckets: [1, 5, 0]
PPC-NEXT: Values: [0xEEBEC3A, 0xB887388, 0xECD54542, 0x7C92E3BB, 0x1C5871D9]
PPC-NEXT: }
PPC64: Arch: powerpc64
PPC64: GnuHashTable {
PPC64-NEXT: Num Buckets: 3
PPC64-NEXT: First Hashed Symbol Index: 1
PPC64-NEXT: Num Mask Words: 1
PPC64-NEXT: Shift Count: 6
PPC64-NEXT: Bloom Filter: [0x800000001204288]
PPC64-NEXT: Buckets: [1, 4, 0]
PPC64-NEXT: Values: [0xB887388, 0xECD54542, 0x7C92E3BB, 0x1C5871D9]
PPC64-NEXT: }