aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-08-23 09:45:11 +0100
committerNick Clifton <nickc@redhat.com>2016-08-23 09:46:36 +0100
commit6342be709e8749d0a44c02e1876ddca360bfd52f (patch)
treec9fd400aca8eb36fbb834dc78de11aa5e437dd7d /bfd/elf32-arm.c
parent344bde0a7f812ff03139ab53aecd61674eb143bf (diff)
downloadgdb-6342be709e8749d0a44c02e1876ddca360bfd52f.zip
gdb-6342be709e8749d0a44c02e1876ddca360bfd52f.tar.gz
gdb-6342be709e8749d0a44c02e1876ddca360bfd52f.tar.bz2
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.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 1eba21b..4478238 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