[RFA:] In bfd_assert at the end, call _exit (EXIT_FAILURE)
Hans-Peter Nilsson
hans-peter.nilsson@axis.com
Mon Mar 23 14:50:00 GMT 2009
I can't find the posting where Nick asked for patches after
finding consensus that bfd_assert should exit rather than
continue (causing incorrect files to be written and the point of
failure only noticeable by inspecting build logs), but here's
the simple approach I took. No regressions for cris-elf.
Ok to commit?
bfd:
* bfd.c (bfd_assert): Call _exit (EXIT_FAILURE).
Index: bfd.c
===================================================================
RCS file: /cvs/src/src/bfd/bfd.c,v
retrieving revision 1.106
diff -p -u -r1.106 bfd.c
--- bfd.c 20 Nov 2008 09:28:06 -0000 1.106
+++ bfd.c 23 Mar 2009 14:46:44 -0000
@@ -911,6 +911,12 @@ bfd_assert (const char *file, int line)
{
(*_bfd_error_handler) (_("BFD %s assertion fail %s:%d"),
BFD_VERSION_STRING, file, line);
+
+ /* We used to just return from bfd_assert, but that caused more
+ grief than relief. The different code paths for bfd_assert and
+ _bfd_abort could be united but keeping them separate can
+ simplify debugging. */
+ _exit (EXIT_FAILURE);
}
/* A more or less friendly abort message. In libbfd.h abort is
brgds, H-P
More information about the Binutils
mailing list