This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Question: BFD_FAIL


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;



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]