Lines Matching full:hash

1 ## Check llvm-readelf is able to dump the content of hash sections correctly.
3 ## Check the output when both .hash and .gnu.hash sections are present.
6 # RUN: llvm-readelf --hash-symbols %t1-32.so \
7 # RUN: | FileCheck %s --strict-whitespace --match-full-lines --check-prefix HASH-32
10 # RUN: llvm-readelf --hash-symbols %t1-64.so | FileCheck %s --check-prefix HASH-64
12 # HASH-32: Symbol table of .hash for image:
13 # HASH-32-NEXT: Num Buc: Value Size Type Bind Vis Ndx Name
14 # HASH-32-NEXT: 1 0: 00000000 0 NOTYPE GLOBAL DEFAULT UND ccc
15 # HASH-32-NEXT: 5 0: 00001001 0 NOTYPE WEAK DEFAULT 1 bbb
16 # HASH-32-NEXT: 3 0: 00000001 0 NOTYPE GLOBAL DEFAULT ABS ddd
17 # HASH-32-NEXT: 2 0: 00001000 0 NOTYPE GLOBAL DEFAULT 1 aaa
18 # HASH-32-NEXT: 4 0: 00000000 0 NOTYPE GLOBAL DEFAULT 2 eee
19 # HASH-32-EMPTY:
20 # HASH-32: Symbol table of .gnu.hash for image:
21 # HASH-32-NEXT: Num Buc: Value Size Type Bind Vis Ndx Name
22 # HASH-32-NEXT: 2 1: 00001000 0 NOTYPE GLOBAL DEFAULT 1 aaa
23 # HASH-32-NEXT: 3 1: 00000001 0 NOTYPE GLOBAL DEFAULT ABS ddd
24 # HASH-32-NEXT: 4 2: 00000000 0 NOTYPE GLOBAL DEFAULT 2 eee
25 # HASH-32-NEXT: 5 2: 00001001 0 NOTYPE WEAK DEFAULT 1 bbb
26 # HASH-32-NOT: {{.}}
28 # HASH-64: Symbol table of .hash for image:
29 # HASH-64-NEXT: Num Buc: Value Size Type Bind Vis Ndx Name
30 # HASH-64-NEXT: 1 0: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND ccc
31 # HASH-64-NEXT: 5 0: 0000000000001001 0 NOTYPE WEAK DEFAULT 1 bbb
32 # HASH-64-NEXT: 3 0: 0000000000000001 0 NOTYPE GLOBAL DEFAULT ABS ddd
33 # HASH-64-NEXT: 2 0: 0000000000001000 0 NOTYPE GLOBAL DEFAULT 1 aaa
34 # HASH-64-NEXT: 4 0: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 eee
35 # HASH-64-EMPTY:
36 # HASH-64-NEXT: Symbol table of .gnu.hash for image:
37 # HASH-64-NEXT: Num Buc: Value Size Type Bind Vis Ndx Name
38 # HASH-64-NEXT: 2 1: 0000000000001000 0 NOTYPE GLOBAL DEFAULT 1 aaa
39 # HASH-64-NEXT: 3 1: 0000000000000001 0 NOTYPE GLOBAL DEFAULT ABS ddd
40 # HASH-64-NEXT: 4 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 eee
41 # HASH-64-NEXT: 5 2: 0000000000001001 0 NOTYPE WEAK DEFAULT 1 bbb
42 # HASH-64-NOT: {{.}}
50 - Name: .hash
56 - Name: .gnu.hash
72 ## llvm-readelf will read .hash content from PT_LOAD's p_offset + (DT_HASH value - p_vaddr).
73 ## This matches the file offset of the .hash section.
77 ## PT_LOAD's p_vaddr is 0x0. DT_GNU_HASH value is 0x2c (size of .hash = 0x2c).
78 ## llvm-readelf will read .gnu.hash content from PT_LOAD's p_offset + (DT_GNU_HASH value - p_vaddr).
79 ## This matches the file offset of the .gnu.hash section.
88 Section: .hash
98 Section: .gnu.hash
102 Section: .hash
109 FirstSec: .hash
114 # RUN: llvm-readelf --hash-symbols %t1-sec-syms.so 2>&1 | \
117 # UNNAMED-SEC-SYMS: Symbol table of .hash for image:
121 # UNNAMED-SEC-SYMS-NEXT: 5 {{.*}} 1 .hash
124 # UNNAMED-SEC-SYMS-NEXT: 2 {{.*}} 1 .hash
125 # UNNAMED-SEC-SYMS-NEXT: 4 {{.*}} 2 .gnu.hash
127 # UNNAMED-SEC-SYMS: Symbol table of .gnu.hash for image:
129 # UNNAMED-SEC-SYMS-NEXT: 2 {{.*}} 1 .hash
131 # UNNAMED-SEC-SYMS-NEXT: 4 {{.*}} 2 .gnu.hash
132 # UNNAMED-SEC-SYMS-NEXT: 5 {{.*}} 1 .hash
134 ## Check the output when only .hash section is present.
137 # RUN: llvm-readelf --hash-symbols %t2-32.so \
138 # RUN: | FileCheck %s --strict-whitespace --match-full-lines --check-prefix ONLY-HASH-32
140 # ONLY-HASH-32: Symbol table of .hash for image:
141 # ONLY-HASH-32-NEXT: Num Buc: Value Size Type Bind Vis Ndx Name
142 # ONLY-HASH-32-NEXT: 1 0: 00000000 0 NOTYPE GLOBAL DEFAULT UND ccc
143 # ONLY-HASH-32-NEXT: 5 0: 00001001 0 NOTYPE WEAK DEFAULT 1 bbb
144 # ONLY-HASH-32-NEXT: 3 0: 00000001 0 NOTYPE GLOBAL DEFAULT ABS ddd
145 # ONLY-HASH-32-NEXT: 2 0: 00001000 0 NOTYPE GLOBAL DEFAULT 1 aaa
146 # ONLY-HASH-32-NEXT: 4 0: 00000000 0 NOTYPE GLOBAL DEFAULT 2 eee
147 # ONLY-HASH-32-NOT: {{.}}
155 - Name: .hash
174 Section: .hash
185 Section: .hash
191 FirstSec: .hash
194 ## Check the output when only .gnu.hash section is present.
197 # RUN: llvm-readelf --hash-symbols %t3-32.so \
200 # ONLY-GNUHASH-32: Symbol table of .gnu.hash for image:
214 - Name: .gnu.hash
245 Section: .gnu.hash
254 FirstSec: .gnu.hash
257 ## Show that if there are no hash sections, we do not print anything.
259 # RUN: llvm-readelf --hash-symbols %t4.so \
260 # RUN: | FileCheck %s --check-prefix NO-HASH --allow-empty
262 # NO-HASH-NOT: {{.}}
327 ## Show that we report a warning for a hash table which contains an entry of
331 # RUN: llvm-readelf --hash-symbols %t5.so 2>&1 | \
334 # BROKEN: Symbol table of .hash for image:
337 # BROKEN: warning: '[[FILE]]': .hash section is invalid: bucket 1: a cycle was detected in the link…
347 - Name: .hash
355 ## llvm-readelf will read the hash table from the file offset
357 ## which is the start of PT_LOAD, i.e. the file offset of .hash.
364 FirstSec: .hash
371 # RUN: llvm-readelf --hash-symbols %t6.o 2>&1 | FileCheck %s --check-prefix=ERR1 -DFILE=%t6.o
373 # ERR1: warning: '[[FILE]]': the hash table at offset 0x2b1 goes past the end of the file (0x2b8){{…
381 - Name: .hash
398 FirstSec: .hash
401 ## Check we report a warning when the hash table goes past the end of the file.
403 ## Case A.1: the hash table ends right before the EOF. We have a broken nbucket
406 # RUN: llvm-readelf --hash-symbols %t7.1.o 2>&1 | FileCheck %s --check-prefix=NOERR1
407 # NOERR1: Symbol table of .hash for image:
411 ## Case A.2: the hash table ends 1 byte past the EOF. We have a broken nbucket
414 # RUN: llvm-readelf --hash-symbols %t7.2.o 2>&1 | FileCheck %s --check-prefix=ERR2 -DFILE=%t7.2.o
415 # ERR2: Symbol table of .hash for image:
416 # ERR2-NEXT: warning: '[[FILE]]': the hash table at offset 0x54 goes past the end of the file (0x1d…
419 ## Case B.1: the hash table ends right before the EOF. We have a broken nchain
422 # RUN: llvm-readelf --hash-symbols %t7.3.o 2>&1 | \
424 # NOERR2: warning: '[[FILE]]': hash table nchain (93) differs from symbol count derived from S…
425 …': the size (0x5d0) of the dynamic symbol table at 0x78, derived from the hash table, goes past th…
426 # NOERR2: Symbol table of .hash for image:
430 ## Case B.2: the hash table ends 1 byte past the EOF. We have a broken nchain
433 # RUN: llvm-readelf --hash-symbols %t7.4.o 2>&1 | FileCheck %s --check-prefix=ERR3 -DFILE=%t7.4.o
434 # ERR3: Symbol table of .hash for image:
435 # ERR3-NEXT: warning: '[[FILE]]': the hash table at offset 0x54 goes past the end of the file (0x1d…
444 - Name: .hash
462 FirstSec: .hash
465 ## Check we report a proper warning when a GNU hash table goes past the end of the file.
469 # RUN: llvm-readelf --hash-symbols %t.err.maskwords 2>&1 | \
472 # ERR4: Symbol table of .gnu.hash for image:
478 # RUN: llvm-readelf --hash-symbols %t.err.nbuckets 2>&1 | \
487 - Name: .gnu.hash
495 ## The number of hash buckets. The value of 3 is no-op.
521 FirstSec: .gnu.hash
526 …eck we report a warning when the dynamic symbol table is empty and we attempt to print hash symbols
527 ## from the .hash table. The number of symbols in the dynamic symbol table can be calculate…
528 ## or derived from the Chain vector of the .hash table. Make both ways to return a zero to …
530 # RUN: llvm-readelf --hash-symbols %t9.1.so 2>&1 | FileCheck %s -DFILE=%t9.1.so --check-prefix=DYNS…
532 # DYNSYM-EMPTY-HASH: Symbol table of .hash for image:
533 # DYNSYM-EMPTY-HASH-NEXT: Num Buc: Value Size Type Bind Vis Ndx Name
534 # DYNSYM-EMPTY-HASH-NEXT: warning: '[[FILE]]': unable to print symbols for the .hash table: the dyn…
535 # DYNSYM-EMPTY-HASH-NOT: {{.}}
543 - Name: .hash
555 ## PT_LOAD p_offset == .hash offset == 0x54.
572 FirstSec: .hash
578 # RUN: llvm-readelf --hash-symbols %t9.2.so 2>&1 | FileCheck %s -DFILE=%t9.2.so --check-prefix=DYNS…
580 # DYNSYM-NOTFOUND-HASH: Symbol table of .hash for image:
581 # DYNSYM-NOTFOUND-HASH-NEXT: Num Buc: Value Size Type Bind Vis Ndx Name
582 # DYNSYM-NOTFOUND-HASH-NEXT: warning: '[[FILE]]': unable to print symbols for the .hash table: the …
583 # DYNSYM-NOTFOUND-HASH-NOT: {{.}}
586 ## hash symbols from the .gnu.hash table.
588 # RUN: llvm-readelf --hash-symbols %t10.1.so 2>&1 | FileCheck %s -DFILE=%t10.1.so --check-prefix=DY…
590 # DYNSYM-EMPTY-GNUHASH: Symbol table of .gnu.hash for image:
592 # DYNSYM-EMPTY-GNUHASH-NEXT: warning: '[[FILE]]': unable to print symbols for the .gnu.hash table: …
598 # RUN: llvm-readelf --hash-symbols %t10.2.so 2>&1 | FileCheck %s -DFILE=%t10.2.so --check-prefix=DY…
600 # DYNSYM-NOTFOUND-GNUHASH: Symbol table of .gnu.hash for image:
602 # DYNSYM-NOTFOUND-GNUHASH-NEXT: warning: '[[FILE]]': unable to print symbols for the .gnu.hash tabl…
611 - Name: .gnu.hash
627 ## PT_LOAD p_offset == .hash offset == 0x54.
643 FirstSec: .gnu.hash
646 ## In this case we have a broken value in the hash buckets array. Normally it contains an
647 ## index into the dynamic symbol table and also is used to get a hash value from the hash values ar…
651 # RUN: llvm-readelf --hash-symbols %t11.past.dynsym.so 2>&1 | \
654 # BUCKET-PAST-DYNSYM: Symbol table of .gnu.hash for image:
666 - Name: .gnu.hash
691 FirstSec: .gnu.hash
694 ## In this case we are unable to read a hash value for a symbol with
698 # RUN: llvm-readelf --hash-symbols %t11.first.hashed.so 2>&1 | \
701 # FIRST-HASHED: Symbol table of .gnu.hash for image:
703 # FIRST-HASHED-NEXT: warning: '[[FILE]]': unable to get hash values for the SHT_GNU_HASH section: t…
705 # FIRST-HASHED-NEXT: warning: '[[FILE]]': unable to read the hash value for symbol with index 1, wh…
713 # RUN: llvm-readelf --hash-symbols %t11.chain.bit.so 2>&1 | \
716 # CHAIN-BIT: Symbol table of .gnu.hash for image: