This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb/linaro_binutils-2_27-branch] Fix seg-fault in ARM linker when trying to parse a binary file.
- From: Christophe Lyon <clyon at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 19 Oct 2016 08:33:21 -0000
- Subject: [binutils-gdb/linaro_binutils-2_27-branch] Fix seg-fault in ARM linker when trying to parse a binary file.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fbc6c6763e70cb2376e2de990c7fc54c0ee44a59
commit fbc6c6763e70cb2376e2de990c7fc54c0ee44a59
Author: Nick Clifton <nickc@redhat.com>
Date: Tue Aug 23 09:45:11 2016 +0100
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:
---
bfd/ChangeLog | 5 +++++
bfd/elf32-arm.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ef5e387..8365175 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 3d4a458..dbd2911 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