Igor Kudrin | 496fb2f | 2015-10-14 12:11:50 +0000 | [diff] [blame] | 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 | |
| 15 | RUN: llvm-readobj -gnu-hash-table %p/Inputs/gnuhash.so.elf-i386 | FileCheck %s -check-prefix I386 |
| 16 | RUN: llvm-readobj -gnu-hash-table %p/Inputs/gnuhash.so.elf-x86_64 | FileCheck %s -check-prefix X86_64 |
| 17 | RUN: llvm-readobj -gnu-hash-table %p/Inputs/gnuhash.so.elf-ppc | FileCheck %s -check-prefix PPC |
| 18 | RUN: llvm-readobj -gnu-hash-table %p/Inputs/gnuhash.so.elf-ppc64 | FileCheck %s -check-prefix PPC64 |
| 19 | |
| 20 | I386: Arch: i386 |
| 21 | I386: GnuHashTable { |
| 22 | I386-NEXT: Num Buckets: 3 |
| 23 | I386-NEXT: First Hashed Symbol Index: 1 |
| 24 | I386-NEXT: Num Mask Words: 1 |
| 25 | I386-NEXT: Shift Count: 5 |
| 26 | I386-NEXT: Bloom Filter: [0x39004608] |
| 27 | I386-NEXT: Buckets: [1, 4, 0] |
| 28 | I386-NEXT: Values: [0xB887388, 0xECD54542, 0x7C92E3BB, 0x1C5871D9] |
| 29 | I386-NEXT: } |
| 30 | |
| 31 | X86_64: Arch: x86_64 |
| 32 | X86_64: GnuHashTable { |
| 33 | X86_64-NEXT: Num Buckets: 3 |
| 34 | X86_64-NEXT: First Hashed Symbol Index: 1 |
| 35 | X86_64-NEXT: Num Mask Words: 1 |
| 36 | X86_64-NEXT: Shift Count: 6 |
| 37 | X86_64-NEXT: Bloom Filter: [0x800000001204288] |
| 38 | X86_64-NEXT: Buckets: [1, 4, 0] |
| 39 | X86_64-NEXT: Values: [0xB887388, 0xECD54542, 0x7C92E3BB, 0x1C5871D9] |
| 40 | X86_64-NEXT: } |
| 41 | |
| 42 | PPC: Arch: powerpc |
| 43 | PPC: GnuHashTable { |
| 44 | PPC-NEXT: Num Buckets: 3 |
| 45 | PPC-NEXT: First Hashed Symbol Index: 1 |
| 46 | PPC-NEXT: Num Mask Words: 1 |
| 47 | PPC-NEXT: Shift Count: 5 |
| 48 | PPC-NEXT: Bloom Filter: [0x3D00460A] |
| 49 | PPC-NEXT: Buckets: [1, 5, 0] |
| 50 | PPC-NEXT: Values: [0xEEBEC3A, 0xB887388, 0xECD54542, 0x7C92E3BB, 0x1C5871D9] |
| 51 | PPC-NEXT: } |
| 52 | |
| 53 | PPC64: Arch: powerpc64 |
| 54 | PPC64: GnuHashTable { |
| 55 | PPC64-NEXT: Num Buckets: 3 |
| 56 | PPC64-NEXT: First Hashed Symbol Index: 1 |
| 57 | PPC64-NEXT: Num Mask Words: 1 |
| 58 | PPC64-NEXT: Shift Count: 6 |
| 59 | PPC64-NEXT: Bloom Filter: [0x800000001204288] |
| 60 | PPC64-NEXT: Buckets: [1, 4, 0] |
| 61 | PPC64-NEXT: Values: [0xB887388, 0xECD54542, 0x7C92E3BB, 0x1C5871D9] |
| 62 | PPC64-NEXT: } |
| 63 | |