Question: BFD_FAIL

msnyder@sonic.net msnyder@sonic.net
Wed Jul 25 19:07:00 GMT 2007


Hi all,

Are we meant to assume that BFD_FAIL does not return?

It calls bfd_assert, which calls (*_bfd_error_handler), which is
overrideable -- but the default error handler in bfd.c does return.

Existing code seems inconsistant, even within the same module.
Some invocations are followed by a break or a return, others aren't.

I'm looking at a case in bfd.c where, if it does return, we will
immediately dereference a null pointer:

void
_bfd_set_gp_value (bfd *abfd, bfd_vma v)
{
  if (! abfd)
    BFD_FAIL ();
  if (abfd->format != bfd_object)
    return;




More information about the Binutils mailing list