This is the mail archive of the binutils@sourceware.org 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]

PATCH: Have readelf report unused bytes at the end of a .debug_loc section


Hi Guys,

  I am checking in the attached patch to add a warning message to
  display_debug_loc() if it detects that there are unused bytes at the
  end of the .debug_loc section.

Cheers
  Nick
    
binutils/ChangeLog
2007-11-20  Nick Clifton  <nickc@redhat.com>

	* dwarf.c (display_debug_loc): Issue a warning if there are bytes
	at the end of the .debug_loc section which are not referenced by
	any attribute in the .debug_info section.

Index: binutils/dwarf.c
===================================================================
RCS file: /cvs/src/src/binutils/dwarf.c,v
retrieving revision 1.20
diff -c -3 -p -r1.20 dwarf.c
*** binutils/dwarf.c	16 Nov 2007 15:36:21 -0000	1.20
--- binutils/dwarf.c	21 Nov 2007 11:55:38 -0000
*************** display_debug_loc (struct dwarf_section 
*** 2624,2629 ****
--- 2624,2633 ----
  	    }
  	}
      }
+ 
+   if (start < section_end)
+     warn (_("There are %ld unused bytes at the end of section %s\n"),
+ 	  section_end - start, section->name);
    return 1;
  }
  


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