aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-12-19 01:23:46 +0000
committerIan Lance Taylor <iant@google.com>2007-12-19 01:23:46 +0000
commit2030fba084282b271caba7c8e32abfd847a8eca7 (patch)
treed8bc012f68af7cbb2f706495e54f40892b8c3d43 /gold/merge.cc
parentAvoid some warnings which showed up in 64-bit mode. (diff)
downloadbinutils-gdb-2030fba084282b271caba7c8e32abfd847a8eca7.tar.gz
binutils-gdb-2030fba084282b271caba7c8e32abfd847a8eca7.tar.bz2
binutils-gdb-2030fba084282b271caba7c8e32abfd847a8eca7.zip
Move Stringpool offsets into a chunked_vector indexed by keys.
Diffstat (limited to 'gold/merge.cc')
-rw-r--r--gold/merge.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/gold/merge.cc b/gold/merge.cc
index 2c76759db60..01f2a9e1380 100644
--- a/gold/merge.cc
+++ b/gold/merge.cc
@@ -520,12 +520,13 @@ Output_merge_string<Char_type>::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<Char_type>::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);
}