[Patch, moxie] Print 'bad' instructions in disassembly instead of aborting

Hans-Peter Nilsson hp@bitrange.com
Fri Sep 28 20:30:00 GMT 2012


On Fri, 28 Sep 2012, Joel Brobecker wrote:
> > If other ports are doing this, it's an accident waiting to happen.
>
> ISTR bfd doing it too, because we tripped over something like that.
> BFD noticed a bad RELA entry and thought it was a sign of an internal
> error. So it aborted

It should have called bfd_assert.

> and GDB never had a chance to handle the situation
> more gracefully.

Have a look at bfd_assert in bfd.c.  GDB is one of those libbfd
clients that would benefit from calling bfd_set_assert_handler
(recently added, post binutils-2.22) with a handler function to
do longjmp to error recovery of the current command or
something.  See ld/ldmain.c for usage.

brgds, H-P



More information about the Binutils mailing list