diff options
author | Alan Modra <amodra@gmail.com> | 2014-12-10 09:51:56 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-12-10 23:00:51 +1030 |
commit | e00e81980c70659d0efe686b31a55db5faaa91f9 (patch) | |
tree | 95c316a165c37f3d3cc8cc03995b089ad8e66b21 /bfd/elf-bfd.h | |
parent | fa15f18deaf6f48e0b415ad3e8864de0b1cf6a39 (diff) | |
download | binutils-e00e81980c70659d0efe686b31a55db5faaa91f9.zip binutils-e00e81980c70659d0efe686b31a55db5faaa91f9.tar.gz binutils-e00e81980c70659d0efe686b31a55db5faaa91f9.tar.bz2 |
Don't return DW_AT_name for function name in C++
DW_AT_name for functions typically just contains the base function
name, so lacks namespace, class and parameter information. It would
be possible to extract all these from the DWARF, but at a considerable
complication of the parser in dwarf2.c, and then you'd need to mangle
it all together. Much simpler is to look up the actual symbol. This
patch does that, avoiding the extra symbol lookup when the language
doesn't do name mangling.
PR 17541
* dwarf2.c (struct comp_unit): Add "lang".
(non_mangled): New function.
(struct funcinfo): Add "is_linkage". Reorder for better packing.
Make "name" a const char*.
(lookup_address_in_function_table): Delete functionname_ptr param.
(find_abstract_instance_name): Add is_linkage param. Set if we
have DW_AT_linkage_name or non_mangled DW_AT_name.
(scan_unit_for_symbols): Similarly set func->is_linkage.
(parse_comp_unit): Stash DW_AT_language.
(comp_unit_find_nearest_line): Replace functionname_ptr param
with function_ptr param.
(_bfd_dwarf2_find_nearest_line): Adjust above calls. Set
functionname_ptr from function->name. Call _bfd_elf_find_function
to retrieve symbol for function if not linkage name.
(_bfd_elf_find_function): Add bfd_target_elf_flavour test, moved from..
* elf.c (elf_find_function): ..here.
(_bfd_elf_find_nearest_line): Adjust calls.
* elf-bfd.h (_bfd_elf_find_function): Declare.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r-- | bfd/elf-bfd.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 514fdcd..6ce70bc 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1911,6 +1911,8 @@ 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 + (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 extern int _bfd_elf_sizeof_headers |