This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Patch: _bfd_elf_find_nearest_line
- From: Nick Clifton <nickc at redhat dot com>
- To: aph at cambridge dot redhat dot com
- Cc: binutils at sources dot redhat dot com, java at gcc dot gnu dot org
- Date: 11 Sep 2002 15:34:11 +0100
- Subject: Re: Patch: _bfd_elf_find_nearest_line
- References: <200209061531.g86FVV325141@cuddles.cambridge.redhat.com>
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