diff options
author | Rui Ueyama <ruiu@google.com> | 2017-03-01 18:09:09 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2017-03-01 18:09:09 +0000 |
commit | 7986b4544b9d9e0441466573afebaf9e778c6bed (patch) | |
tree | c4710282fbdc193d09915a2c8a5f84bf4582812c | |
parent | d5d27e16d423953ba51644bcf8d5b068a1fbbcc4 (diff) | |
download | bcm5719-llvm-7986b4544b9d9e0441466573afebaf9e778c6bed.tar.gz bcm5719-llvm-7986b4544b9d9e0441466573afebaf9e778c6bed.zip |
Add a reference to a Ulrich Drepper's paper.
llvm-svn: 296650
-rw-r--r-- | lld/ELF/SyntheticSections.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index b0477d2f066..97d6a7ce982 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -1479,12 +1479,19 @@ template <class ELFT> void GnuHashTableSection<ELFT>::writeTo(uint8_t *Buf) { write32<E>(Buf + 12, getShift2()); Buf += 16; + // Write a bloom filter and a hash table. writeBloomFilter(Buf); Buf += sizeof(uintX_t) * MaskWords; - writeHashTable(Buf); } +// This function writes a 2-bit bloom filter. This bloom filter alone +// usually filters out 80% or more of all symbol lookups [1]. +// The dynamic linker uses the hash table only when a symbol is not +// filtered out by a bloom filter. +// +// [1] Ulrich Drepper (2011), "How To Write Shared Libraries" (Ver. 4.1.2), +// p.9, https://www.akkadia.org/drepper/dsohowto.pdf template <class ELFT> void GnuHashTableSection<ELFT>::writeBloomFilter(uint8_t *Buf) { typedef typename ELFT::Off Elf_Off; |