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: Patch: _bfd_elf_find_nearest_line


Hi Andrew,

> There's a bug in _bfd_elf_find_nearest_line.
> 
> Try this:
> 
> ~ > gcc hello.c 
> ~ > nm a.out | grep main
> 08048378 T main
> ~ > addr2line -f 08048378
> ??
> /usr/src/build/87998-i386/BUILD/glibc-2.2.5/csu/init.c:0

Well I tried this and addr2line gave me the correct output, so maybe
there is something else going on here.  However...

> Unfortunately, _bfd_stab_section_find_nearest_line() returns
> found=true if it's found a .stab section, not if it's actually found a
> symbol.  You have to check the data that it returned to find that.

I agree that this is correct, so ...

> 2002-09-06  Andrew Haley  <aph@cambridge.redhat.com>
> 
> 	* elf.c (_bfd_elf_find_nearest_line): Check functionname_ptr and
> 	line_ptr before deciding we've found a symbol.

Approved and applied.

Cheers
        Nick


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