This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] Introduce dwfl_module_getsym_info and dwfl_module_addrinfo.
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 13 Dec 2013 07:53:50 +0100
- Subject: Re: [PATCH] Introduce dwfl_module_getsym_info and dwfl_module_addrinfo.
On Thu, 12 Dec 2013 11:51:37 +0100, Mark Wielaard wrote:
> +/* Fetch one entry from the module's symbol table and the associated
> + address value. On errors, returns NULL. If successful, fills in
> + *SYM, *ADDR and returns the string for st_name. This works like
> + gelf_getsym. *ADDR is set to the st_value adjusted to an absolute
> + value based on the module's location, when the symbol is in an
> + SHF_ALLOC section. For non-ET_REL files, if the arch uses function
> + descriptors, and the st_value points to one, the value will be
> + resolved to the actual function address. Note that since symbols
> + can come from either the main, debug or auxiliary ELF symbol file
> + (either dynsym or symtab) and the st_value itself isn't adjusted in
> + any way (this is different from dwfl_module_getsym). */
> +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.
It could also document sh_info does not match the local vs. global symbols;
but that can be documented at any time.
Jan