about summary refs log tree commit diff
path: root/elf/stringtable.h
Commit message (Collapse)AuthorAgeFilesLines
* elf: Implement a string table for ldconfig, with tail mergingFlorian Weimer2020-12-041-0/+64
This will be used in ldconfig to reduce the ld.so.cache size slightly. Tail merging is an optimization where a pointer points into another string if the first string is a suffix of the second string. The hash function FNV-1a was chosen because it is simple and achieves good dispersion even for short strings (so that the hash table bucket count can be a power of two). It is clearly superior to the hsearch hash and the ELF hash in this regard. The hash table uses chaining for collision resolution. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>