| 29 | |
| 30 | #[repr(C)] |
| 31 | pub(crate) struct GnuHashTable<'a> { |
| 32 | /// Index of the first symbol in the `.dynsym` table which is accessible with |
| 33 | /// the hash table |
| 34 | symindex: u32, |
| 35 | /// Shift count used in the bloom filter |
| 36 | shift2: u32, |
| 37 | /// 2 bit bloom filter on `chains` |
| 38 | // Either 32 or 64-bit depending on the class of object |
| 39 | bloom_filter: &'a [usize], |
| 40 | /// GNU hash table bucket array; indexes start at 0. This array holds symbol |
| 41 | /// table indexes and contains the index of hashes in `chains` |
| 42 | buckets: &'a [u32], |
| 43 | /// Hash values; indexes start at 0. This array holds symbol table indexes. |
| 44 | chains: &'a [u32], // => chains[dynsyms.len() - symindex] |
| 45 | dynsyms: &'a [DynEntry], |
| 46 | } |
| 47 | |
| 48 | impl<'a> GnuHashTable<'a> { |
| 49 | unsafe fn new(hashtab: &'a [u8], dynsyms: &'a [DynEntry]) -> GnuHashTable<'a> { |
nothing calls this directly
no outgoing calls
no test coverage detected