This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] MIPS/BFD: Fix assertions with SGI IRIX files
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "Maciej W. Rozycki" <macro at codesourcery dot com>
- Cc: binutils at sourceware dot org, gdb-patches at sourceware dot org
- Date: Fri, 19 Aug 2011 10:42:01 +0100
- Subject: Re: [PATCH] MIPS/BFD: Fix assertions with SGI IRIX files
- References: <alpine.DEB.email@example.com>
"Maciej W. Rozycki" <firstname.lastname@example.org> writes:
> 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.
How about just dropping the assertions? SHN_MIPS_TEXT and SHN_MIPS_DATA
are easy to handle, and it looks like the code will behave sensibly
regardless of SGI_COMPAT. I realise you might be thinking that the user
would like to know that they have the "wrong" emulation. But if this
is the only detectable difference, it's better just to carry on.
If there are other detectable differences that cause real problems,
we should try to diagnose the problem there instead.
A patch to remove the assertions is pre-approved if you agree that's OK.