aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-12-04 23:11:35 +0000
committerIan Lance Taylor <iant@google.com>2007-12-04 23:11:35 +0000
commitabaa399568d8dea6b959350e387968eb746115c9 (patch)
tree23c1bb93b71b6c732cc908b6b470a481232f82e0 /gold/symtab.cc
parentfd4980a3b8749aa27c12b4eacaa7f654d24c1957 (diff)
downloadgdb-abaa399568d8dea6b959350e387968eb746115c9.zip
gdb-abaa399568d8dea6b959350e387968eb746115c9.tar.gz
gdb-abaa399568d8dea6b959350e387968eb746115c9.tar.bz2
Print symbol table statistics with --stats.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index b2901ab..6094c2a 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -1897,6 +1897,20 @@ Symbol_table::sized_write_section_symbol(const Output_section* os,
of->write_output_view(offset, sym_size, pov);
}
+// Print statistical information to stderr. This is used for --stats.
+
+void
+Symbol_table::print_stats() const
+{
+#if defined(HAVE_TR1_UNORDERED_MAP) || defined(HAVE_EXT_HASH_MAP)
+ fprintf(stderr, _("%s: symbol table entries: %zu; buckets: %zu\n"),
+ program_name, this->table_.size(), this->table_.bucket_count());
+#else
+ fprintf(stderr, _("%s: symbol table entries: %zu\n"),
+ program_name, this->table_.size());
+#endif
+}
+
// We check for ODR violations by looking for symbols with the same
// name for which the debugging information reports that they were
// defined in different source locations. When comparing the source