From 923b198a8426f02866f33362b26ed8bbf7a5c5cd Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 2 Dec 2015 15:46:48 +1030 Subject: 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/elf-bfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bfd/elf-bfd.h') diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 2b05089a526..70e33275054 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1996,7 +1996,7 @@ extern bfd_boolean _bfd_elf_find_line (bfd *, asymbol **, asymbol *, const char **, unsigned int *); extern bfd_boolean _bfd_elf_find_inliner_info (bfd *, const char **, const char **, unsigned int *); -extern bfd_boolean _bfd_elf_find_function +extern asymbol *_bfd_elf_find_function (bfd *, asymbol **, asection *, bfd_vma, const char **, const char **); #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol -- cgit v1.2.1