[lld] r296650 - Add a reference to a Ulrich Drepper's paper.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 1 10:09:10 PST 2017


Author: ruiu
Date: Wed Mar  1 12:09:09 2017
New Revision: 296650

URL: http://llvm.org/viewvc/llvm-project?rev=296650&view=rev
Log:
Add a reference to a Ulrich Drepper's paper.

Modified:
    lld/trunk/ELF/SyntheticSections.cpp

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=296650&r1=296649&r2=296650&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed Mar  1 12:09:09 2017
@@ -1479,12 +1479,19 @@ template <class ELFT> void GnuHashTableS
   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;




More information about the llvm-commits mailing list