Fix crash when processing merge section with entsize of 0.

2015-02-04  Peter Collingbourne  <pcc@google.com>
            Cary Coutant  <ccoutant@google.com>

gold/
	* output.cc (Output_section::add_merge_input_section): Do not
	attempt to merge sections with an entsize of 0.
This commit is contained in:
Cary Coutant 2015-03-02 10:20:21 -08:00
parent 5b07cd848d
commit 2c7b626cee
2 changed files with 10 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2015-02-04 Peter Collingbourne <pcc@google.com>
Cary Coutant <ccoutant@google.com>
* output.cc (Output_section::add_merge_input_section): Do not
attempt to merge sections with an entsize of 0.
2015-02-02 Khem Raj <raj.khem@gmail.com>
* attributes.h (class Output_attributes_section_data ): Add

View file

@ -2636,6 +2636,10 @@ Output_section::add_merge_input_section(Relobj* object, unsigned int shndx,
uint64_t addralign,
bool keeps_input_sections)
{
// We cannot merge sections with entsize == 0.
if (entsize == 0)
return false;
bool is_string = (flags & elfcpp::SHF_STRINGS) != 0;
// We cannot restore merged input section states.