This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
fix powerpc64 ld segfault
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sourceware dot org
- Date: Sun, 1 Oct 2006 23:30:56 +0930
- Subject: fix powerpc64 ld segfault
It's possible for the .plt section to be created but never used, so this
test should have also checked that htab->plt->size was non-zero. Better,
since this particular piece of code is dealing with setting up .glink,
do the checks on htab->glink.
* elf64-ppc.c (ppc64_elf_build_stubs): Test glink size for
existence of PLT.
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.246
diff -u -p -r1.246 elf64-ppc.c
--- bfd/elf64-ppc.c 16 Sep 2006 18:12:14 -0000 1.246
+++ bfd/elf64-ppc.c 30 Sep 2006 13:48:19 -0000
@@ -9451,7 +9451,7 @@ ppc64_elf_build_stubs (bfd_boolean emit_
stub_sec->size = 0;
}
- if (htab->plt != NULL)
+ if (htab->glink != NULL && htab->glink->size != 0)
{
unsigned int indx;
bfd_vma plt0;
--
Alan Modra
IBM OzLabs - Linux Technology Centre