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)
committerNick Clifton <nickc@redhat.com>
Tue, 23 Aug 2016 08:46:36 +0000 (09:46 +0100)
* 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 1aad274f1dc1623690508c2dab354b9056e36cf1..84fceea4fac7cce9f21e0c5b8d605071ccf09666 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-23  Alan Modra  <amodra@gmail.com>
 
        PR 20475
index 1eba21b42ddfaf3704860107e4fff36dbbc24d8d..4478238ee0074cca85fda4331b1c2bb2981431f3 100644 (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