Fix dwp to allow intermediate .dwp files with no .debug_types sections.
gold/ * dwp.cc (Dwo_file::read): Allow files with no .debug_types sections. (Dwo_file::sized_read_unit_index): Likewise.
This commit is contained in:
parent
f179cf97a0
commit
cb818dbff5
|
@ -1,3 +1,9 @@
|
||||||
|
2014-06-24 Cary Coutant <ccoutant@google.com>
|
||||||
|
|
||||||
|
* dwp.cc (Dwo_file::read): Allow files with no .debug_types
|
||||||
|
sections.
|
||||||
|
(Dwo_file::sized_read_unit_index): Likewise.
|
||||||
|
|
||||||
2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
|
2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
|
||||||
|
|
||||||
* mips.cc: New file.
|
* mips.cc: New file.
|
||||||
|
|
13
gold/dwp.cc
13
gold/dwp.cc
|
@ -970,10 +970,13 @@ Dwo_file::read(Dwp_output_file* output_file)
|
||||||
this->read_unit_index(debug_cu_index, debug_shndx, output_file, false);
|
this->read_unit_index(debug_cu_index, debug_shndx, output_file, false);
|
||||||
if (debug_tu_index > 0)
|
if (debug_tu_index > 0)
|
||||||
{
|
{
|
||||||
if (debug_types.size() != 1)
|
if (debug_types.size() > 1)
|
||||||
gold_fatal(_("%s: .dwp file must have exactly one "
|
gold_fatal(_("%s: .dwp file must have no more than one "
|
||||||
".debug_types.dwo section"), this->name_);
|
".debug_types.dwo section"), this->name_);
|
||||||
debug_shndx[elfcpp::DW_SECT_TYPES] = debug_types[0];
|
if (debug_types.size() == 1)
|
||||||
|
debug_shndx[elfcpp::DW_SECT_TYPES] = debug_types[0];
|
||||||
|
else
|
||||||
|
debug_shndx[elfcpp::DW_SECT_TYPES] = 0;
|
||||||
this->read_unit_index(debug_tu_index, debug_shndx, output_file, true);
|
this->read_unit_index(debug_tu_index, debug_shndx, output_file, true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -1154,7 +1157,7 @@ Dwo_file::sized_read_unit_index(unsigned int shndx,
|
||||||
: elfcpp::DW_SECT_INFO);
|
: elfcpp::DW_SECT_INFO);
|
||||||
unsigned int info_shndx = debug_shndx[info_sect];
|
unsigned int info_shndx = debug_shndx[info_sect];
|
||||||
|
|
||||||
gold_assert(shndx > 0 && info_shndx > 0);
|
gold_assert(shndx > 0);
|
||||||
|
|
||||||
section_size_type index_len;
|
section_size_type index_len;
|
||||||
bool index_is_new;
|
bool index_is_new;
|
||||||
|
@ -1180,6 +1183,8 @@ Dwo_file::sized_read_unit_index(unsigned int shndx,
|
||||||
if (ncols == 0 || nused == 0)
|
if (ncols == 0 || nused == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
gold_assert(info_shndx > 0);
|
||||||
|
|
||||||
unsigned int nslots =
|
unsigned int nslots =
|
||||||
elfcpp::Swap_unaligned<32, big_endian>::readval(contents
|
elfcpp::Swap_unaligned<32, big_endian>::readval(contents
|
||||||
+ 3 * sizeof(uint32_t));
|
+ 3 * sizeof(uint32_t));
|
||||||
|
|
Loading…
Reference in New Issue