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]

[RFA:] In bfd_assert at the end, call _exit (EXIT_FAILURE)


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


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