]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
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>
Thu, 10 Dec 2015 13:48:48 +0000 (00:18 +1030)
commit6ae72d11333f98d2366c35b98c7fc9db6ff25551
tree45c8c76372ffe4e7a373dddd5ac1352bb572928d
parent3c2d791fbf1b16ad661d2f2d4917166ea900a0e6
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