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]

Re: readelf core-dumped


Hi Shaun,

: I ran readelf -w (--target=arm-elf) on my Dwarf1 (-gdwarf) .o and it
: caused readelf to coredump.

Any particular reason that you are using DWARF1 instead of DWARF2 ?

: Are any morbids out there interested in the files that cause readelf
: to blow its brains out?

Nah - I was able to reproduce the problem myself.  The patch below
fixes it.  (I will check the patch into sourceware shortly).

Cheers
	Nick

2000-08-17  Nick Clifton  <nickc@redhat.com>

	* readelf.c (display_debug_pubnames): Only issue warning
	message once.  Terminate message with a new line.
	(display_debug_aranges): Only display version 2 debug info.

Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src//src/binutils/readelf.c,v
retrieving revision 1.67
diff -p -r1.67 readelf.c
*** readelf.c	2000/08/08 00:47:04	1.67
--- readelf.c	2000/08/17 22:56:55
*************** display_debug_pubnames (section, start, 
*** 5225,5231 ****
  
        if (pubnames.pn_version != 2)
  	{
! 	  warn (_("Only DWARF 2 pubnames are currently supported"));
  	  continue;
  	}
  
--- 5225,5238 ----
  
        if (pubnames.pn_version != 2)
  	{
! 	  static int warned = 0;
! 
! 	  if (! warned)
! 	    {
! 	      warn (_("Only DWARF 2 pubnames are currently supported\n"));
! 	      warned = 1;
! 	    }
! 	  
  	  continue;
  	}
  
*************** display_debug_aranges (section, start, f
*** 6396,6401 ****
--- 6403,6414 ----
        arange.ar_info_offset  = BYTE_GET (external->ar_info_offset);
        arange.ar_pointer_size = BYTE_GET (external->ar_pointer_size);
        arange.ar_segment_size = BYTE_GET (external->ar_segment_size);
+ 
+       if (arange.ar_version != 2)
+ 	{
+ 	  warn (_("Only DWARF 2 aranges are currently supported.\n"));
+ 	  break;
+ 	}
  
        printf (_("  Length:                   %ld\n"), arange.ar_length);
        printf (_("  Version:                  %d\n"), arange.ar_version);

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