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


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 ?

Cheers
 Nick

bfd/ChangeLog
2004-04-15  Nick Clifton  <nickc@redhat.com>

* bfd.c (bfd_archive_filename): Catch NULL bfd pointers.


Index: bfd/bfd.c
===================================================================
RCS file: /cvs/src/src/bfd/bfd.c,v
retrieving revision 1.55
diff -c -3 -p -r1.55 bfd.c
*** bfd/bfd.c	24 Nov 2003 18:06:39 -0000	1.55
--- bfd/bfd.c	15 Apr 2004 08:47:30 -0000
*************** DESCRIPTION
*** 512,517 ****
--- 512,520 ----
  const char *
  bfd_archive_filename (bfd *abfd)
  {
+   if (abfd == NULL)
+     return _("<unknown>");
+   
    if (abfd->my_archive)
      {
        static size_t curr = 0;

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