From 031cec08290bc337a9de8dd532c2b7f8546f815a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 1 May 2013 19:45:27 +0000 Subject: Restore empty string handling * merge.cc (Output_merge_string::do_add_input_section): Restore empty string handling. --- gold/ChangeLog | 5 +++++ gold/merge.cc | 18 ++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'gold') diff --git a/gold/ChangeLog b/gold/ChangeLog index a6f3d59854..164da85b7d 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2013-05-01 H.J. Lu + + * merge.cc (Output_merge_string::do_add_input_section): + Restore empty string handling. + 2013-05-01 Cary Coutant * stringpool.cc (Stringpool_template::new_key_offset): Fix diff --git a/gold/merge.cc b/gold/merge.cc index 6480bd9331..2d01462935 100644 --- a/gold/merge.cc +++ b/gold/merge.cc @@ -565,18 +565,16 @@ Output_merge_string::do_add_input_section(Relobj* object, { size_t len = string_length(p); - if (len != 0) - { - // Within merge input section each string must be aligned. - if ((reinterpret_cast(p) & (this->addralign() - 1)) - != init_align_modulo) - has_misaligned_strings = true; + // Within merge input section each string must be aligned. + if (len != 0 + && ((reinterpret_cast(p) & (this->addralign() - 1)) + != init_align_modulo)) + has_misaligned_strings = true; - Stringpool::Key key; - this->stringpool_.add_with_length(p, len, true, &key); + Stringpool::Key key; + this->stringpool_.add_with_length(p, len, true, &key); - merged_strings.push_back(Merged_string(i, key)); - } + merged_strings.push_back(Merged_string(i, key)); p += len + 1; i += (len + 1) * sizeof(Char_type); } -- cgit v1.2.1