This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix powerpc64 ld segfault on invalid input


I managed to make ld segfault recently, when forcing ld to attempt
linking a powerpc libc.a into a powerpc64 output.  This cures it.

	* elf64-ppc.c (ppc64_elf_size_stubs): Don't consider non-ppc64 input.

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.226
diff -u -p -r1.226 elf64-ppc.c
--- bfd/elf64-ppc.c	18 Nov 2005 04:52:57 -0000	1.226
+++ bfd/elf64-ppc.c	12 Dec 2005 03:52:17 -0000
@@ -8912,6 +8912,9 @@ ppc64_elf_size_stubs (bfd *output_bfd,
 	  asection *section;
 	  Elf_Internal_Sym *local_syms = NULL;
 
+	  if (!is_ppc64_elf_target (input_bfd->xvec))
+	    continue;
+
 	  /* We'll need the symbol table in a second.  */
 	  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
 	  if (symtab_hdr->sh_info == 0)

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]