diff options
author | Ian Lance Taylor <iant@google.com> | 2007-12-19 01:23:46 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-12-19 01:23:46 +0000 |
commit | 2030fba084282b271caba7c8e32abfd847a8eca7 (patch) | |
tree | d8bc012f68af7cbb2f706495e54f40892b8c3d43 /gold/merge.cc | |
parent | Avoid some warnings which showed up in 64-bit mode. (diff) | |
download | binutils-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.cc | 9 |
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); } |