]> git.ipfire.org Git - thirdparty/glibc.git/commit
elf: Implement a string table for ldconfig, with tail merging
authorFlorian Weimer <fweimer@redhat.com>
Fri, 4 Dec 2020 08:13:43 +0000 (09:13 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 4 Dec 2020 08:16:41 +0000 (09:16 +0100)
commit785969a047ad2f23f758901c6816422573544453
tree02a98a4f402f44b404c8656a8dcd9e6795871a0d
parentdfb3f101c5ef23adf60d389058a2b33e23303d04
elf: Implement a string table for ldconfig, with tail merging

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>
elf/Makefile
elf/stringtable.c [new file with mode: 0644]
elf/stringtable.h [new file with mode: 0644]
elf/stringtable_free.c [new file with mode: 0644]
elf/tst-stringtable.c [new file with mode: 0644]