[PATCH] Introduce dwfl_module_getsym_info and dwfl_module_addrinfo.

Mark Wielaard mjw at redhat.com
Mon Dec 16 12:50:41 UTC 2013


On Fri, 2013-12-13 at 07:53 +0100, Jan Kratochvil wrote:
> On Thu, 12 Dec 2013 11:51:37 +0100, Mark Wielaard wrote:
> > +extern const char *dwfl_module_getsym_info (Dwfl_Module *mod, int ndx,
> > +					    GElf_Sym *sym, GElf_Addr *addr)
> > +  __nonnull_attribute__ (3, 4);
> 
> Not sure if you have considered dropping the first NULL ELF symbol, when it is
> a new API anyway.  OTOH it will simplify neither caller nor the
> implementation.

Indeed, it wouldn't simplify anything really.

> It could also document sh_info does not match the local vs. global symbols;
> but that can be documented at any time.

Yeah, since the table is independent of any underlying ELF symbol table
the user cannot match any sh_info field. We should probably just provide
that info directly to the user, since we have it and it can be used for
optimizing how one searching through the table.

The attached patch does that by introducing a new function
dwfl_module_getsymtab_first_global which is then also used in our own
implementation.

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libdwfl-Add-dwfl_module_getsymtab_first_global.patch
Type: text/x-patch
Size: 5358 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/elfutils-devel/attachments/20131216/c214adbb/attachment-0001.bin>


More information about the elfutils-devel mailing list