[prev in list] [next in list] [prev in thread] [next in thread] 

List:       binutils
Subject:    [committed] fix ld segfault for mipsisa64-elf
From:       Eric Christopher <echristo () apple ! com>
Date:       2007-05-25 23:05:50
Message-ID: 4EC009CA-5916-4D0D-A15F-BACED5F54BEC () apple ! com
[Download RAW message or body]

For lots of c++ files ld is currently segfaulting in  
_bfd_elf_discard_section_eh_frame because sym_sec is NULL and we're  
not checking that it exists before we check the value of a member.  
This fixes that problem, we've still got other problems such that  
we're not creating .eh_frame_table, but that's a patch for another  
day. I'm looking into it while waiting for builds on other work :)

Committed as obvious.

-eric

2007-05-25  Eric Christopher  <echristo@gmail.com>

	* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Check that  
sym_sec
	isn't NULL before accessing.


["eh_frame.diff.txt" (eh_frame.diff.txt)]

Index: elf-eh-frame.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-eh-frame.c,v
retrieving revision 1.58
diff -u -p -w -r1.58 elf-eh-frame.c
--- elf-eh-frame.c	12 May 2007 14:27:34 -0000	1.58
+++ elf-eh-frame.c	25 May 2007 22:59:55 -0000
@@ -712,7 +712,8 @@ _bfd_elf_discard_section_eh_frame
 			      sym = &cookie->locsyms[r_symndx];
 			      sym_sec = (bfd_section_from_elf_index
 					 (abfd, sym->st_shndx));
-			      if (sym_sec->kept_section != NULL)
+			      if (sym_sec != NULL
+				  && sym_sec->kept_section != NULL)
 				sym_sec = sym_sec->kept_section;
 			      if (sym_sec != NULL
 				  && sym_sec->output_section != NULL)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic