* object.cc (Sized_relobj::map_to_kept_section): Return NULL if the

kept comdat section was garbage collected.
	* testsuite/Makefile.am: Add test gc_comdat_test.sh.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/gc_comdat_test.sh: New file.
	* testsuite/gc_comdat_test_1.cc: New file.
	* testsuite/gc_comdat_test_2.cc: New file.
This commit is contained in:
Sriraman Tallam
2009-05-22 18:31:22 +00:00
parent ad04f5cebf
commit 531813adfc
7 changed files with 196 additions and 44 deletions

View File

@@ -1873,8 +1873,8 @@ Sized_relobj<size, big_endian>::map_to_kept_section(
*found = true;
Output_section* os = kept->object_->output_section(kept->shndx_);
Address offset = kept->object_->get_output_section_offset(kept->shndx_);
gold_assert(os != NULL && offset != invalid_address);
return os->address() + offset;
if (os != NULL && offset != invalid_address)
return os->address() + offset;
}
*found = false;
return 0;