1 From 72b09de92cc597c53b1d762882b67a17fe56846c Mon Sep 17 00:00:00 2001
2 From: Nick Clifton <nickc@redhat.com>
3 Date: Tue, 23 Aug 2016 09:45:11 +0100
4 Subject: [PATCH 16/16] Fix seg-fault in ARM linker when trying to parse a
7 * elf32-arm.c (elf32_arm_count_additional_relocs): Return zero if
8 there is no arm data associated with the section.
10 Upstream-Status: Backport
11 Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 bfd/elf32-arm.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
16 diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
17 index 700bec3..3fab609 100644
20 @@ -18207,7 +18207,7 @@ elf32_arm_count_additional_relocs (asection *sec)
22 struct _arm_elf_section_data *arm_data;
23 arm_data = get_arm_elf_section_data (sec);
24 - return arm_data->additional_reloc_count;
25 + return arm_data == NULL ? 0 : arm_data->additional_reloc_count;
28 /* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which