Fix seg-fault in ARM linker when trying to parse a binary file.

* elf32-arm.c (elf32_arm_count_additional_relocs): Return zero if
	there is no arm data associated with the section.
This commit is contained in:
Nick Clifton 2016-08-23 09:45:11 +01:00
parent 344bde0a7f
commit 6342be709e
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2016-08-23 Nick Clifton <nickc@redhat.com>
* elf32-arm.c (elf32_arm_count_additional_relocs): Return zero if
there is no arm data associated with the section.
2016-08-23 Alan Modra <amodra@gmail.com>
PR 20475

View file

@ -18688,7 +18688,7 @@ elf32_arm_count_additional_relocs (asection *sec)
{
struct _arm_elf_section_data *arm_data;
arm_data = get_arm_elf_section_data (sec);
return arm_data->additional_reloc_count;
return arm_data == NULL ? 0 : arm_data->additional_reloc_count;
}
/* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which