This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Fix segfault in MIPS bfd
- From: Thiemo Seufer <ths at networkno dot de>
- To: binutils at sourceware dot org
- Date: Fri, 11 Aug 2006 14:53:45 +0100
- Subject: [PATCH] Fix segfault in MIPS bfd
Hello All,
I applied the appended patch, it fixes a ld testsuite failure in
NOCROSSREFS 3 caused by a segfault in BFD.
Thiemo
2006-08-11 Thiemo Seufer <ths@mips.com>
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Set
sh_entsize only when sgot was already initialized.
Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.178
diff -u -p -r1.178 elfxx-mips.c
--- bfd/elfxx-mips.c 25 Jul 2006 09:17:56 -0000 1.178
+++ bfd/elfxx-mips.c 11 Aug 2006 13:39:51 -0000
@@ -8789,11 +8789,10 @@ _bfd_mips_elf_finish_dynamic_sections (b
MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0x80000000,
sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd));
}
- }
- if (sgot != NULL)
- elf_section_data (sgot->output_section)->this_hdr.sh_entsize
- = MIPS_ELF_GOT_SIZE (output_bfd);
+ elf_section_data (sgot->output_section)->this_hdr.sh_entsize
+ = MIPS_ELF_GOT_SIZE (output_bfd);
+ }
/* Generate dynamic relocations for the non-primary gots. */
if (gg != NULL && gg->next)