This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Problem with linker with binutils-040414
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:
> > Hi Guys,
> >
> > Daniel Kulp wrote:
> >
> > >I have confirmed that on line 3637 of elflink.c, old_bfd is null and thus
> > >the call to bfd_archive_filename cores.
> > >
> > In line with this suggestion I am going to apply the following patch to
> > stop bfd_archive_filename() seg-faulting when it is passed a NULL bfd
> > pointer.
> >
> > Daniel - Do you want me to apply this to the 2.15 branch ?
>
> Yes, please do.
>
> > 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 ();
H.J.