[lld] r327555 - Separate sentences to clarify a comment.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 14 12:01:00 PDT 2018


Author: ruiu
Date: Wed Mar 14 12:01:00 2018
New Revision: 327555

URL: http://llvm.org/viewvc/llvm-project?rev=327555&view=rev
Log:
Separate sentences to clarify a comment.

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=327555&r1=327554&r2=327555&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed Mar 14 12:01:00 2018
@@ -1800,13 +1800,15 @@ void GnuHashTableSection::addSymbols(std
         return !S.Sym->isDefined();
       });
 
-  // Even if the hash table does not contain symbols, we still want to keep the
-  // section to indicate to a loader that the file exports no symbols. We can't
-  // have zero buckets because the android loader doesn't support that. We chose
-  // load factor 4 for the on-disk hash table. For each hash collision, the
-  // dynamic linker will compare a uint32_t hash value. Since the integer
-  // comparison is quite fast, we believe we can make the load factor even
-  // larger. 4 is just a conservative choice.
+  // We chose load factor 4 for the on-disk hash table. For each hash
+  // collision, the dynamic linker will compare a uint32_t hash value.
+  // Since the integer comparison is quite fast, we believe we can
+  // make the load factor even larger. 4 is just a conservative choice.
+  //
+  // Note that we don't want to create a zero-sized hash table because
+  // Android loader as of 2018 doesn't like a .gnu.hash containing such
+  // table. If that's the case, we create a hash table with one unused
+  // dummy slot.
   NBuckets = std::max<size_t>((V.end() - Mid) / 4, 1);
 
   if (Mid == V.end())




More information about the llvm-commits mailing list