This is the mail archive of the binutils@sources.redhat.com 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]

RE: Problem with linker with binutils-040414


> -----Original Message-----
> From: binutils-owner On Behalf Of Alan Modra
> Sent: 17 April 2004 13:06

> On Fri, Apr 16, 2004 at 08:11:38AM -0700, H. J. Lu wrote:
> > On Fri, Apr 16, 2004 at 12:22:35AM -0400, Daniel Jacobowitz wrote:
> > > On Thu, Apr 15, 2004 at 09:48:03AM +0100, Nick Clifton wrote:
> > > > bfd/ChangeLog
> > > > 2004-04-15  Nick Clifton  <nickc@redhat.com>
> > > > 
> > > >    * bfd.c (bfd_archive_filename): Catch NULL bfd pointers.
> > 
> > I don't think it is a good idea. Linker should try to avoid 
> core dump
> > on bad input. But linker should abort/core dump when there is an
> > internal bug. In this particular case, core dump helped 
> uncover/fix the
> > linker bug. Otherwise, we might discover this bug much 
> later. I suggest
> > we back out this patch or change it to
> > 
> > 	if (abfd == NULL)
> > 	  abort ();
> 
> FWIW, I agree with HJ.

It's also explicitly suggested to do things that way in the GNU coding
standards document:

http://www.gnu.org/prep/standards_13.html#SEC13

"4.1 Writing Robust Programs 

[...snip...]

In error checks that detect "impossible" conditions, just abort. There is
usually no point in printing any message. These checks indicate the
existence of bugs. Whoever wants to fix the bugs will have to read the
source code and run a debugger. So explain the problem with comments in the
source. The relevant data will be in variables, which are easy to examine
with the debugger, so there is no point moving them elsewhere. "


    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


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