question about dwarf.c
Alan Modra
amodra@gmail.com
Fri Aug 13 13:06:00 GMT 2010
On Thu, Aug 12, 2010 at 11:40:47AM -0700, Cary Coutant wrote:
> > The crash occurs because the call to process_abbrev_section subtracts
> > out the section address, thus passing an invalid pointer to
> > process_abbrev_section.
> >
> > Can someone explain the reason for this? I don't understand it.
>
> It looks like a bug, pure and simple, to me. Notice that
> section.address is *not* subtracted in forming the ending address.
Applied.
* dwarf.c (process_debug_info): Don't subtract section address
when calculating location of cu abbrev within section.
Index: binutils/dwarf.c
===================================================================
RCS file: /cvs/src/src/binutils/dwarf.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -p -r1.71 -r1.72
--- binutils/dwarf.c 3 Aug 2010 10:24:18 -0000 1.71
+++ binutils/dwarf.c 13 Aug 2010 00:21:19 -0000 1.72
@@ -2077,8 +2077,7 @@ process_debug_info (struct dwarf_section
else
process_abbrev_section
((unsigned char *) debug_displays [abbrev_sec].section.start
- + compunit.cu_abbrev_offset
- - debug_displays [abbrev_sec].section.address,
+ + compunit.cu_abbrev_offset,
(unsigned char *) debug_displays [abbrev_sec].section.start
+ debug_displays [abbrev_sec].section.size);
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list