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