Prevent a run time segmentation fault when stripping a corrupt binary.

PR 20096
	* objcopy.c (copy_relocations_in_section): Also check for the
	symbol pointed to by sym_ptr_ptr being NULL.
This commit is contained in:
Nick Clifton 2016-05-18 15:21:16 +01:00
parent 9e8f9b05ad
commit f507bebf45
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-05-18 Nick Clifton <nickc@redhat.com>
PR 20096
* objcopy.c (copy_relocations_in_section): Also check for the
symbol pointed to by sym_ptr_ptr being NULL.
2016-05-18 Maciej W. Rozycki <macro@imgtec.com>
* testsuite/binutils-all/mips/mixed-mips16-micromips.d: New test.

View File

@ -3250,7 +3250,9 @@ copy_relocations_in_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
for (i = 0; i < relcount; i++)
{
/* PR 17512: file: 9e907e0c. */
if (relpp[i]->sym_ptr_ptr)
if (relpp[i]->sym_ptr_ptr
/* PR 20096 */
&& * relpp[i]->sym_ptr_ptr)
if (is_specified_symbol (bfd_asymbol_name (*relpp[i]->sym_ptr_ptr),
keep_specific_htab))
temp_relpp [temp_relcount++] = relpp [i];