Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] MIPS/BFD: Fix assertions with SGI IRIX files
@ 2011-08-18 16:41 Maciej W. Rozycki
  0 siblings, 0 replies; 8+ messages in thread
From: Maciej W. Rozycki @ 2011-08-18 16:41 UTC (permalink / raw)
  To: binutils; +Cc: gdb-patches

Hello,

 If an SGI IRIX ELF variation binary (also produced by binutils for some 
target configurations) is loaded into GDB configured for the traditional 
MIPS ELF variation, then a load of assertion failures is spat.  They 
actually come from BFD being confused.

 As no user input, however unreasonable, should ever trigger assertions 
and this is simply a case of an unsupported binary format, here's a fix to 
convert the offending code to do proper error reporting instead.

 Verified manually with GDB, the error messages are produced.  I was 
unable to trigger this problem with the linker, even though this piece of 
code looks reachable within to me.

 OK to apply?

2011-08-18  Maciej W. Rozycki  <macro@codesourcery.com>

	bfd/
	* elfxx-mips.c (_bfd_mips_elf_symbol_processing): Replace
	assertions with warning messages.

  Maciej

binutils-mips-sgi-err.diff
Index: binutils-fsf-trunk-quilt/bfd/elfxx-mips.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/bfd/elfxx-mips.c	2011-08-03 14:02:30.000000000 +0100
+++ binutils-fsf-trunk-quilt/bfd/elfxx-mips.c	2011-08-03 14:04:07.000000000 +0100
@@ -6350,7 +6350,10 @@ _bfd_mips_elf_symbol_processing (bfd *ab
       {
 	asection *section = bfd_get_section_by_name (abfd, ".text");
 
-	BFD_ASSERT (SGI_COMPAT (abfd));
+	if (!SGI_COMPAT (abfd))
+	  _bfd_error_handler (_("%B: Warning: SGI IRIX format special section "
+				"%s unsupported with the selected emulation"),
+			      abfd, "MIPS_TEXT");
 	if (section != NULL)
 	  {
 	    asym->section = section;
@@ -6366,7 +6369,10 @@ _bfd_mips_elf_symbol_processing (bfd *ab
       {
 	asection *section = bfd_get_section_by_name (abfd, ".data");
 
-	BFD_ASSERT (SGI_COMPAT (abfd));
+	if (!SGI_COMPAT (abfd))
+	  _bfd_error_handler (_("%B: Warning: SGI IRIX format special section "
+				"%s unsupported with the selected emulation"),
+			      abfd, "MIPS_DATA");
 	if (section != NULL)
 	  {
 	    asym->section = section;


^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <alpine.DEB.1.10.1108181530580.4083__36247.0631408089$1313685694$gmane$org@tp.orcam.me.uk>]

end of thread, other threads:[~2011-11-16 12:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-18 16:41 [PATCH] MIPS/BFD: Fix assertions with SGI IRIX files Maciej W. Rozycki
     [not found] <alpine.DEB.1.10.1108181530580.4083__36247.0631408089$1313685694$gmane$org@tp.orcam.me.uk>
2011-08-19  9:42 ` Richard Sandiford
2011-08-31 18:01   ` Maciej W. Rozycki
2011-08-31 20:14     ` Richard Sandiford
2011-09-02 10:06       ` Maciej W. Rozycki
2011-10-24 14:02         ` Maciej W. Rozycki
2011-11-15 17:29           ` Richard Sandiford
2011-11-16 12:37             ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox