Fix empty string alignment in .rodata.str*
gold/ PR gold/18959 * stringpool.cc (Stringpool_template::new_key_offset): Align all strings, even zero-length. (Stringpool_template::set_string_offsets):
This commit is contained in:
parent
e79a4bad70
commit
a817ff49c3
@ -1,3 +1,10 @@
|
|||||||
|
2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
|
||||||
|
|
||||||
|
PR gold/18959
|
||||||
|
* stringpool.cc (Stringpool_template::new_key_offset): Align all
|
||||||
|
strings, even zero-length.
|
||||||
|
(Stringpool_template::set_string_offsets): Likewise.
|
||||||
|
|
||||||
2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
|
2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
|
||||||
|
|
||||||
* s390.cc: New file.
|
* s390.cc: New file.
|
||||||
|
@ -228,9 +228,8 @@ Stringpool_template<Stringpool_char>::new_key_offset(size_t length)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
offset = this->offset_;
|
offset = this->offset_;
|
||||||
// Align non-zero length strings.
|
// Align strings.
|
||||||
if (length != 0)
|
offset = align_address(offset, this->addralign_);
|
||||||
offset = align_address(offset, this->addralign_);
|
|
||||||
this->offset_ = offset + (length + 1) * sizeof(Stringpool_char);
|
this->offset_ = offset + (length + 1) * sizeof(Stringpool_char);
|
||||||
}
|
}
|
||||||
this->key_to_offset_.push_back(offset);
|
this->key_to_offset_.push_back(offset);
|
||||||
@ -421,6 +420,8 @@ Stringpool_template<Stringpool_char>::set_string_offsets()
|
|||||||
if (this->zero_null_ && (*curr)->first.string[0] == 0)
|
if (this->zero_null_ && (*curr)->first.string[0] == 0)
|
||||||
this_offset = 0;
|
this_offset = 0;
|
||||||
else if (last != v.end()
|
else if (last != v.end()
|
||||||
|
&& ((((*curr)->first.length - (*last)->first.length)
|
||||||
|
% this->addralign_) == 0)
|
||||||
&& is_suffix((*curr)->first.string,
|
&& is_suffix((*curr)->first.string,
|
||||||
(*curr)->first.length,
|
(*curr)->first.length,
|
||||||
(*last)->first.string,
|
(*last)->first.string,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user