From 6342be709e8749d0a44c02e1876ddca360bfd52f Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 23 Aug 2016 09:45:11 +0100 Subject: [PATCH] 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. --- bfd/ChangeLog | 5 +++++ bfd/elf32-arm.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1aad274f1dc..84fceea4fac 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-23 Alan Modra PR 20475 diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 1eba21b42dd..4478238ee00 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -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 -- 2.30.2