diff options
author | Rui Ueyama <ruiu@google.com> | 2018-03-14 19:01:00 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2018-03-14 19:01:00 +0000 |
commit | 4e6b822cdc2b4780c084aff39f59bd60cba0260c (patch) | |
tree | aa2a9487b82781a0d357ffbda6bac26020bbbf88 | |
parent | fd82fd000cb527830ce7288323ccf442becb551f (diff) | |
download | bcm5719-llvm-4e6b822cdc2b4780c084aff39f59bd60cba0260c.tar.gz bcm5719-llvm-4e6b822cdc2b4780c084aff39f59bd60cba0260c.zip |
Separate sentences to clarify a comment.
llvm-svn: 327555
-rw-r--r-- | lld/ELF/SyntheticSections.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index a95b83596b1..ef7944c8100 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -1800,13 +1800,15 @@ void GnuHashTableSection::addSymbols(std::vector<SymbolTableEntry> &V) { 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()) |