addr2line vs. inlined C functions called from C++
authorAlan Modra <amodra@gmail.com>
Wed, 2 Dec 2015 05:16:48 +0000 (15:46 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 2 Dec 2015 13:25:51 +0000 (23:55 +1030)
commit923b198a8426f02866f33362b26ed8bbf7a5c5cd
treed88697dfaa76f5c49207fe729990fa938a2a12e8
parent26e3a0c9ba4a8376fdf9f898637919d144d8b1d8
addr2line vs. inlined C functions called from C++

In this case the inlined function doesn't have DW_AT_linkage_name in
.debug_info, but the language is C++ so find_nearest_line goes looking
in the symbol table.  Since the function is inlined the enclosing
non-inline function symbol is returned from _bfd_elf_find_function,
which is wrong.  This patch only uses a symbol if its address matches.

PR binutils/19315
* dwarf2.c (_bfd_elf_find_function): Return symbol matched.
(_bfd_dwarf2_find_nearest_line): Check symbol returned above
against dwarf range.
* elf-bfd.h (_bfd_elf_find_function): Update prototype.
bfd/ChangeLog
bfd/dwarf2.c
bfd/elf-bfd.h