fix spu-ld segfault

Alan Modra amodra@bigpond.net.au
Thu Apr 12 10:42:00 GMT 2007


Fixes a segfault when processing absolute symbols.

	* elf32-spu.c (needs_ovl_stub): Test that spu_elf_section_data
	is non-NULL before dereferencing.

Index: bfd/elf32-spu.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-spu.c,v
retrieving revision 1.10
diff -u -p -r1.10 elf32-spu.c
--- bfd/elf32-spu.c	5 Apr 2007 07:01:52 -0000	1.10
+++ bfd/elf32-spu.c	12 Apr 2007 07:13:12 -0000
@@ -704,7 +704,8 @@ needs_ovl_stub (const char *sym_name,
     return FALSE;
 
   if (sym_sec == NULL
-      || sym_sec->output_section == NULL)
+      || sym_sec->output_section == NULL
+      || spu_elf_section_data (sym_sec->output_section) == NULL)
     return FALSE;
 
   /* setjmp always goes via an overlay stub, because then the return

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list