diff options
author | Matthew Fortune <matthew.fortune@imgtec.com> | 2014-11-05 10:56:59 +0000 |
---|---|---|
committer | Matthew Fortune <matthew.fortune@imgtec.com> | 2014-11-05 10:56:59 +0000 |
commit | 131e2f8ea152c814af559df088a0d3019f7f45f2 (patch) | |
tree | 6b0b43395baeec27fc67aeafb8fb4ef404efaea1 /bfd/elfxx-mips.c | |
parent | 09c14161c5bbba3a3969a48efafbff3b9a4de42a (diff) | |
download | gdb-131e2f8ea152c814af559df088a0d3019f7f45f2.zip gdb-131e2f8ea152c814af559df088a0d3019f7f45f2.tar.gz gdb-131e2f8ea152c814af559df088a0d3019f7f45f2.tar.bz2 |
Fix segfault when creating a dso with discarded .dynsym section.
bfd/
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Fix segfault
when creating a dso with discarded dynsym section.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r-- | bfd/elfxx-mips.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index c599366..a88d173 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -11457,9 +11457,11 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd, name = ".dynsym"; elemsize = MIPS_ELF_SYM_SIZE (output_bfd); s = bfd_get_section_by_name (output_bfd, name); - BFD_ASSERT (s != NULL); - dyn.d_un.d_val = s->size / elemsize; + if (s != NULL) + dyn.d_un.d_val = s->size / elemsize; + else + dyn.d_un.d_val = 0; break; case DT_MIPS_HIPAGENO: |