dwfl_module_get|addrsym_elf (Was: [commit] [patch 2/4] Provide __libdwfl_module_getsym to get dwfl_file *)

Jan Kratochvil jan.kratochvil at redhat.com
Tue Nov 26 14:23:26 UTC 2013


On Tue, 26 Nov 2013 15:07:20 +0100, Mark Wielaard wrote:
> For source compatibility it matters more that code outside core/src
> elfutils uses the functions than those within. And these functions are
> used in e.g. systemtap (they do check shndx against SHN_UNDEF).

I see there are many users (26) in Fedora:
$ rpm -qa 'elfutils*' --qf '%{name}\n'|xargs repoquery --whatrequires --archlist=src --enablerepo='*-source' --qf '%{name}'|sort -u
aide btparser compat-gcc-34 cross-gcc ddd dwarves dwlocstat dyninst frysk gcc
glib2 glibc gridengine kernel libdwarf ltrace mesa net-snmp nut pg_top
python-elfdata python-isprelink satyr ski systemtap wireshark


> +const char *
> +dwfl_module_getsym_elf (Dwfl_Module *mod, int ndx,
> +			GElf_Sym *sym, GElf_Word *shndxp, Elf **elfp)
> +{
> +  struct dwfl_file *file;
> +  const char *name = __libdwfl_module_getsym (mod, ndx, sym, shndxp, &file);
> +  if (elfp != NULL)
> +    *elfp = file->elf;
> +  return name;
> +}

Maybe you had a reason for it but we could also just replace
__libdwfl_module_getsym by dwfl_module_getsym_elf now.  It would just require
changing

static inline GElf_Addr
dwfl_deadjust_st_value (Dwfl_Module *mod, struct dwfl_file *symfile,
                        GElf_Addr addr)

so that it accepts Elf * instead of struct dwfl_file * .


Thanks,
Jan


More information about the elfutils-devel mailing list