[PATCH] Add more primes to hash_size_primes.

Martin Liška mliska@suse.cz
Thu Aug 13 12:26:46 GMT 2020


Hi.

I'm debugging why is gas pretty slow for LTO ltrans generation of Firefox.
One thing I noticed is that --hash-size=N is limited to 64K which is pretty
small value for large assembly for Firefox.

Ready for master?
Thanks,
Martin

ChangeLog:

	* bfd/hash.c (bfd_hash_set_default_size): Add more primes
	as biggest one is only 64K.
---
  bfd/hash.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bfd/hash.c b/bfd/hash.c
index 56d18ac317..7c8f699aa8 100644
--- a/bfd/hash.c
+++ b/bfd/hash.c
@@ -667,7 +667,9 @@ bfd_hash_set_default_size (unsigned long hash_size)
    /* Extend this prime list if you want more granularity of hash table size.  */
    static const unsigned long hash_size_primes[] =
      {
-      31, 61, 127, 251, 509, 1021, 2039, 4091, 8191, 16381, 32749, 65537
+      31, 61, 127, 251, 509, 1021, 2039, 4091, 8191, 16381, 32749, 65537,
+      131071, 262139, 524287 , 1048573, 2097143, 4194301, 8388593, 16777213,
+      33554393, 67108859, 134217689, 268435399, 536870909, 1073741789
      };
    unsigned int _index;
  
-- 
2.28.0



More information about the Binutils mailing list