]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix seg-fault in ARM linker when trying to parse a binary file.
authorNick Clifton <nickc@redhat.com>
Tue, 23 Aug 2016 08:45:11 +0000 (09:45 +0100)
committerChristophe Lyon <christophe.lyon@linaro.org>
Thu, 15 Sep 2016 09:02:16 +0000 (11:02 +0200)
* elf32-arm.c (elf32_arm_count_additional_relocs): Return zero if
there is no arm data associated with the section.

bfd/ChangeLog
bfd/elf32-arm.c

index ef5e387f7efdc6f8981c5c8ba09f85d263ec54a8..8365175b19a3ac9b25a801616516737668ab2858 100644 (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-19  Alan Modra  <amodra@gmail.com>
 
        PR 20472
index 3d4a458fe46b2f2e0674ff31d95fa57dab51999c..dbd291138cd6276b3e4108eef2281818256f2fb2 100644 (file)
@@ -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