public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFA:] In bfd_assert at the end, call _exit (EXIT_FAILURE)
@ 2009-03-23 14:50 Hans-Peter Nilsson
  2009-03-23 14:56 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Hans-Peter Nilsson @ 2009-03-23 14:50 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-24  1:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-23 14:50 [RFA:] In bfd_assert at the end, call _exit (EXIT_FAILURE) Hans-Peter Nilsson
2009-03-23 14:56 ` Daniel Jacobowitz
2009-03-23 15:24   ` Hans-Peter Nilsson
2009-03-24  1:45     ` Alan Modra
2009-03-24  1:57       ` Hans-Peter Nilsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).