From: Nick Clifton Date: Tue, 23 Aug 2016 08:45:11 +0000 (+0100) Subject: Fix seg-fault in ARM linker when trying to parse a binary file. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fbc6c6763e70cb2376e2de990c7fc54c0ee44a59;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ef5e387f7ef..8365175b19a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-08-23 Nick Clifton + + * elf32-arm.c (elf32_arm_count_additional_relocs): Return zero if + there is no arm data associated with the section. + 2016-08-19 Alan Modra PR 20472 diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 3d4a458fe46..dbd291138cd 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -18172,7 +18172,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