This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[commit] [patch 2/4] Provide __libdwfl_module_getsym to get dwfl_file *
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 13 Nov 2013 20:08:56 +0100
- Subject: [commit] [patch 2/4] Provide __libdwfl_module_getsym to get dwfl_file *
On Wed, 13 Nov 2013 12:48:29 +0100, Mark Wielaard wrote:
> Looks good, please apply.
Checked in.
> So, I think the user might also want to get hold of the file. Do you
> think it makes sense to provide the user with extended versions of
> getsym and addrsym based on this?
>
> const char *dwfl_module_getsym_elf (Dwfl_Module *mod, int ndx,
> GElf_Sym *sym, GElf_Word *shndxp,
> Elf *elf)
>
> char *dwfl_module_addrsym_elf (Dwfl_Module *mod, GElf_Addr address,
> GElf_Sym *sym, GElf_Word *shndxp,
> Elf *elf)
>
> Where elf will be the main or debug file.
Primarily the current functions
extern const char *dwfl_module_getsym (Dwfl_Module *mod, int ndx,
GElf_Sym *sym, GElf_Word *shndxp)
extern const char *dwfl_module_addrsym (Dwfl_Module *mod, GElf_Addr address,
GElf_Sym *sym, GElf_Word *shndxp)
do not make sense as they are. And current src/ subdir never uses their
*SHNDXP. Therefore either 'GElf_Word *shndxp' should be removed from them
(in API incompatible but ABI compatible way, as usual) or there should be
added the parameter 'Elf *elfp' (again in API incompatible but ABI compatible
way).
For completeness these functions despite referencing 'shndx' do not seem to be
affected by this multi-elf-file problem as it is clearly defined which file
these shndx refer to:
int (*section_address) (Dwfl_Module *mod, void **userdata,
const char *modname, Dwarf_Addr base,
const char *secname,
GElf_Word shndx, const GElf_Shdr *shdr,
Dwarf_Addr *addr);
extern const char *dwfl_module_relocation_info (Dwfl_Module *mod,
unsigned int idx,
GElf_Word *shndxp);
Jan