aboutsummaryrefslogtreecommitdiff
path: root/gold/merge.cc
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2013-05-01 19:45:27 +0000
committerH.J. Lu <hjl.tools@gmail.com>2013-05-01 19:45:27 +0000
commitd3a7cd45fd77177ca578790f0d39856136f3f8b4 (patch)
treed81105a6df63d03e20dc318a023ec13e3b75a935 /gold/merge.cc
parent6ad3dabab5613c44aa20aa8698710351ea554721 (diff)
downloadgdb-d3a7cd45fd77177ca578790f0d39856136f3f8b4.zip
gdb-d3a7cd45fd77177ca578790f0d39856136f3f8b4.tar.gz
gdb-d3a7cd45fd77177ca578790f0d39856136f3f8b4.tar.bz2
Restore empty string handling
* merge.cc (Output_merge_string<Char_type>::do_add_input_section): Restore empty string handling.
Diffstat (limited to 'gold/merge.cc')
-rw-r--r--gold/merge.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/gold/merge.cc b/gold/merge.cc
index 6480bd9..2d01462 100644
--- a/gold/merge.cc
+++ b/gold/merge.cc
@@ -565,18 +565,16 @@ Output_merge_string<Char_type>::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<uintptr_t>(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<uintptr_t>(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);
}