aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-08-12 16:23:32 +0000
committerNick Clifton <nickc@redhat.com>2010-08-12 16:23:32 +0000
commit0883b6e07e59e64e9f5d83662baf125dcf94a412 (patch)
treefbdd7ba7821dae38f5388cc11e74dbb589be8310 /bfd
parentce1a5b52ee67eb594451f92c62a4a92faedc8a61 (diff)
downloadgdb-0883b6e07e59e64e9f5d83662baf125dcf94a412.zip
gdb-0883b6e07e59e64e9f5d83662baf125dcf94a412.tar.gz
gdb-0883b6e07e59e64e9f5d83662baf125dcf94a412.tar.bz2
PR ld/11843
* elflink.c (compute_bucket_count): Avoid futile long searches for the best bucket size.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 528fa3c..1144f0f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-12 Todd Veldhuizen <todd.veldhuizen@logicblox.com>
+
+ PR ld/11843
+ * elflink.c (compute_bucket_count): Avoid futile long searches for
+ the best bucket size.
+
2010-08-09 Richard Henderson <rth@redhat.com>
PR ld/11891
diff --git a/bfd/elflink.c b/bfd/elflink.c
index e0fbc83..074229f 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -5374,6 +5374,7 @@ compute_bucket_count (struct bfd_link_info *info ATTRIBUTE_UNUSED,
const struct elf_backend_data *bed = get_elf_backend_data (dynobj);
unsigned long int *counts;
bfd_size_type amt;
+ unsigned int no_improvement_count = 0;
/* Possible optimization parameters: if we have NSYMS symbols we say
that the hashing table must at least have NSYMS/4 and at most
@@ -5458,7 +5459,12 @@ compute_bucket_count (struct bfd_link_info *info ATTRIBUTE_UNUSED,
{
best_chlen = max;
best_size = i;
+ no_improvement_count = 0;
}
+ /* PR 11843: Avoid futile long searches for the best bucket size
+ when there are a large number of symbols. */
+ else if (++no_improvement_count == 100)
+ break;
}
free (counts);