This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Fix seg-fault in
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Thu, 18 Jun 2009 11:48:33 +0100
- Subject: Fix seg-fault in
Hi Guys,
I am applying the patch below to prevent a seg-fault in
elf_link_sort_relocs which was being triggered by the
powerpc64-linux toolchain.
Cheers
Nick
bfd/ChangeLog
2009-06-18 Nick Clifton <nickc@redhat.com>
* elflink.c (elf_link_sort_relocs): Return early if there are no
relocs to sort.
Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.343
diff -c -3 -p -r1.343 elflink.c
*** bfd/elflink.c 17 Jun 2009 18:08:35 -0000 1.343
--- bfd/elflink.c 18 Jun 2009 10:42:03 -0000
*************** elf_link_sort_relocs (bfd *abfd, struct
*** 8082,8087 ****
--- 8082,8089 ----
+ (i2e - 1) * sizeof (Elf_Internal_Rela));
count = dynamic_relocs->size / ext_size;
+ if (count == 0)
+ return 0;
sort = bfd_zmalloc (sort_elt * count);
if (sort == NULL)