aboutsummaryrefslogtreecommitdiff
path: root/gold/merge.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2010-08-03 20:38:09 +0000
committerCary Coutant <ccoutant@google.com>2010-08-03 20:38:09 +0000
commitfef830db38dc7b443745fca928d5f05c1f867737 (patch)
tree8e65b43e56f3b3be5b611f436ca821f71773ceab /gold/merge.h
parentbfea910e97b4375e2027c52936c79cde94221796 (diff)
downloadgdb-fef830db38dc7b443745fca928d5f05c1f867737.zip
gdb-fef830db38dc7b443745fca928d5f05c1f867737.tar.gz
gdb-fef830db38dc7b443745fca928d5f05c1f867737.tar.bz2
* merge.cc (Output_merge_string::do_add_input_section): Count strings
to reserve space in merged_strings vector. Keep total input size for stats. (Output_merge_string::do_print_merge_stats): Print total input size. * merge.h (Output_merge_string): Add input_size_ field. * stringpool.cc (Stringpool_template::string_length): Move implementations out of Stringpool_template class and place in stringpool.h. * stringpool.h (string_length): Move out of Stringpool_template.
Diffstat (limited to 'gold/merge.h')
-rw-r--r--gold/merge.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/gold/merge.h b/gold/merge.h
index b1284ae..675739e 100644
--- a/gold/merge.h
+++ b/gold/merge.h
@@ -462,7 +462,7 @@ class Output_merge_string : public Output_merge_base
public:
Output_merge_string(uint64_t addralign)
: Output_merge_base(sizeof(Char_type), addralign), stringpool_(),
- merged_strings_lists_(), input_count_(0)
+ merged_strings_lists_(), input_count_(0), input_size_(0)
{
gold_assert(addralign <= sizeof(Char_type));
this->stringpool_.set_no_zero_null();
@@ -566,6 +566,8 @@ class Output_merge_string : public Output_merge_base
Merged_strings_lists merged_strings_lists_;
// The number of entries seen in input files.
size_t input_count_;
+ // The total size of input sections.
+ size_t input_size_;
};
} // End namespace gold.