Skip to content

Commit 4e6b822

Browse files
committed
Separate sentences to clarify a comment.
llvm-svn: 327555
1 parent fd82fd0 commit 4e6b822

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lld/ELF/SyntheticSections.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,13 +1800,15 @@ void GnuHashTableSection::addSymbols(std::vector<SymbolTableEntry> &V) {
18001800
return !S.Sym->isDefined();
18011801
});
18021802

1803-
// Even if the hash table does not contain symbols, we still want to keep the
1804-
// section to indicate to a loader that the file exports no symbols. We can't
1805-
// have zero buckets because the android loader doesn't support that. We chose
1806-
// load factor 4 for the on-disk hash table. For each hash collision, the
1807-
// dynamic linker will compare a uint32_t hash value. Since the integer
1808-
// comparison is quite fast, we believe we can make the load factor even
1809-
// larger. 4 is just a conservative choice.
1803+
// We chose load factor 4 for the on-disk hash table. For each hash
1804+
// collision, the dynamic linker will compare a uint32_t hash value.
1805+
// Since the integer comparison is quite fast, we believe we can
1806+
// make the load factor even larger. 4 is just a conservative choice.
1807+
//
1808+
// Note that we don't want to create a zero-sized hash table because
1809+
// Android loader as of 2018 doesn't like a .gnu.hash containing such
1810+
// table. If that's the case, we create a hash table with one unused
1811+
// dummy slot.
18101812
NBuckets = std::max<size_t>((V.end() - Mid) / 4, 1);
18111813

18121814
if (Mid == V.end())

0 commit comments

Comments
 (0)