This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [patch 1/4] Fix dwfl_module_addrsym for minidebuginfo
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 13 Nov 2013 12:30:17 +0100
- Subject: Re: [patch 1/4] Fix dwfl_module_addrsym for minidebuginfo
Hi Jan,
On Wed, 2013-11-06 at 22:10 +0100, Jan Kratochvil wrote:
> jankratochvil/xauxfile
>
> the existing condition is clearly wrong:
> ((size_t) i < mod->syments ? mod->symfile : &mod->aux_sym)
Yes, dwfl_module_addrsym is inconsistent with how dwfl_module_getsym
calculates this.
> Additionally same_section() cannot compare section number from file X with
> section number from file Y
Urgh. Indeed, I completely missed that. This is somewhat ugly in
general. It is already not easy to see what file the st_shndx or the
returned shndx section number refers to (either the main elf file for
dynsym or the debug file for symtab, which might or might not be the
same). Adding aux_file makes it worse. Wish I had realized that when I
added it.
I am not sure this is fixable, even if we would remove the aux_file
support. Should we just add a comment to the function that the
st_shndx/shndxp cannot be relied upon? Or should we provide a new dwfl
interface that provides the Elf file given a symbol index (somewhat like
this i_to_symfile function)?
> libdwfl/
> 2013-11-06 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> Fix dwfl_module_addrsym for minidebuginfo.
> * dwfl_module_addrsym.c (dwfl_module_addrsym): New variable
> addr_symfile.
> (dwfl_module_addrsym) (same_section): Use it.
> (dwfl_module_addrsym) (i_to_symfile): New function.
> (dwfl_module_addrsym) (search_table): Use it.
This looks correct.
Thanks,
Mark