Tail optimization of string pools (enabled when linker is run with -O2
or greater) should not be done when the section alignment is greater
than the size of the characters in the strings; otherwise, unaligned
strings may result.
gold/
PR gold/18010
* stringpool.cc (Stringpool_template): Don't optimize if section
alignment is greater than sizeof(char).
+2015-03-21 Cary Coutant <cary@google.com>
+
+ PR gold/18010
+ * stringpool.cc (Stringpool_template): Don't optimize if section
+ alignment is greater than sizeof(char).
+
2015-03-21 Cary Coutant <cary@google.com>
PR gold/18048
zero_null_(true), optimize_(false), offset_(sizeof(Stringpool_char)),
addralign_(addralign)
{
- if (parameters->options_valid() && parameters->options().optimize() >= 2)
+ if (parameters->options_valid()
+ && parameters->options().optimize() >= 2
+ && addralign <= sizeof(Stringpool_char))
this->optimize_ = true;
}