aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gold/dynobj.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gold/dynobj.cc b/gold/dynobj.cc
index 6c0a4b2..5581298 100644
--- a/gold/dynobj.cc
+++ b/gold/dynobj.cc
@@ -698,9 +698,11 @@ Dynobj::compute_bucket_count(const std::vector<uint32_t>& hashcodes,
unsigned int symcount = hashcodes.size();
unsigned int ret = 1;
+ const double full_fraction
+ = 1.0 - parameters->options().hash_bucket_empty_fraction();
for (int i = 0; i < buckets_count; ++i)
{
- if (symcount < buckets[i])
+ if (symcount < buckets[i] * full_fraction)
break;
ret = buckets[i];
}