public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Fix spu-ld segfault
@ 2007-07-11 23:11 Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2007-07-11 23:11 UTC (permalink / raw)
  To: binutils

	* emultempl/spuelf.em (embedded_spu_file): Test for NULL path
	before calling base_name, not after.

Index: ld/emultempl/spuelf.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/spuelf.em,v
retrieving revision 1.10
diff -u -p -r1.10 spuelf.em
--- ld/emultempl/spuelf.em	6 Jul 2007 14:09:42 -0000	1.10
+++ ld/emultempl/spuelf.em	11 Jul 2007 22:55:29 -0000
@@ -345,19 +345,19 @@ embedded_spu_file (lang_input_statement_
   for (search = (lang_input_statement_type *) input_file_chain.head;
        search != NULL;
        search = (lang_input_statement_type *) search->next_real_file)
-    {
-      const char *infile = base_name (search->filename);
+    if (search->filename != NULL)
+      {
+	const char *infile = base_name (search->filename);
 
-      if (infile != NULL
-	  && strncmp (infile, "crtbegin", 8) == 0)
-	{
-	  if (infile[8] == 'S')
-	    flags = concat (flags, " -fPIC", NULL);
-	  else if (infile[8] == 'T')
-	    flags = concat (flags, " -fpie", NULL);
-	  break;
-	}
-    }
+	if (strncmp (infile, "crtbegin", 8) == 0)
+	  {
+	    if (infile[8] == 'S')
+	      flags = concat (flags, " -fPIC", NULL);
+	    else if (infile[8] == 'T')
+	      flags = concat (flags, " -fpie", NULL);
+	    break;
+	  }
+      }
 
   /* Use fork() and exec() rather than system() so that we don't
      need to worry about quoting args.  */

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

* fix spu-ld segfault
@ 2007-04-12 10:42 Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2007-04-12 10:42 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-11 22:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-11 23:11 Fix spu-ld segfault Alan Modra
  -- strict thread matches above, loose matches on Subject: below --
2007-04-12 10:42 fix " Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).