From 2030fba084282b271caba7c8e32abfd847a8eca7 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 19 Dec 2007 01:23:46 +0000 Subject: Move Stringpool offsets into a chunked_vector indexed by keys. --- gold/merge.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gold/merge.cc') diff --git a/gold/merge.cc b/gold/merge.cc index 2c76759..01f2a9e 100644 --- a/gold/merge.cc +++ b/gold/merge.cc @@ -520,12 +520,13 @@ Output_merge_string::do_add_input_section(Relobj* object, } } + Stringpool::Key key; const Char_type* str = this->stringpool_.add_with_length(p, pl - p, true, - NULL); + &key); section_size_type bytelen_with_null = ((pl - p) + 1) * sizeof(Char_type); this->merged_strings_.push_back(Merged_string(object, shndx, i, str, - bytelen_with_null)); + bytelen_with_null, key)); p = pl + 1; i += bytelen_with_null; @@ -551,10 +552,8 @@ Output_merge_string::finalize_merged_data() p != this->merged_strings_.end(); ++p) { - size_t charlen_without_null = (p->length / sizeof(Char_type)) - 1; section_offset_type offset = - this->stringpool_.get_offset_with_length(p->string, - charlen_without_null); + this->stringpool_.get_offset_from_key(p->stringpool_key); this->add_mapping(p->object, p->shndx, p->offset, p->length, offset); } -- cgit v1.1