bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bfd_find_nearest_line failure with COFF unsorted line number information


From: Chris Chambreau
Subject: bfd_find_nearest_line failure with COFF unsorted line number information
Date: Tue, 13 May 2003 20:39:22 -0500
User-agent: KMail/1.4.3

Hi,

I've built binutils-2.13.2 on a power3 machine with AIX 5.1.  I've noticed 
that addr2line and calls to bfd_find_nearest_line fail in some cases with 
applications compiled with IBM VA Fortran compilers versions 7.1 and 8.1.

It looks like the coff_find_nearest_line function in bfd/coffgen.c is 
expecting line number information to be sorted by address.  In the case of 
these two compilers, I'm seeing line number information that is not sorted.

I made the following naive change which seemed to address the problem.

-Chris


diff coffgen.c.orig coffgen.c
2321,2336c2321,2323
<   /* If we have been called on this section before, and the offset we
<      want is further down then we can prime the lookup loop.  */
<   sec_data = coff_section_data (abfd, section);
<   if (sec_data != NULL
<       && sec_data->i > 0
<       && offset >= sec_data->offset)
<     {
<       i = sec_data->i;
<       *functionname_ptr = sec_data->function;
<       line_base = sec_data->line_base;
<     }
<   else
<     {
<       i = 0;
<       line_base = 0;
<     }
---
>
>   i = 0;
>   line_base = 0;
2341d2327
<
2351c2337,2349
<               break;
---
>                 {
>                   /*  Find next function  */
>                   l++; i++;
>                   while (l->line_number != 0 && i < section->lineno_count)
>                     {
>                       l++;
>                       i++;
>                     }
>
>                   i--;
>                   continue;
>                 }
>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]