This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] libdwfl: Add minisymtab support.


On Sat, 22 Dec 2012 02:18:36 +0100, Mark Wielaard wrote:
> --- a/libdwfl/dwfl_module_getsym.c
> +++ b/libdwfl/dwfl_module_getsym.c
> @@ -43,7 +43,14 @@ dwfl_module_getsym (Dwfl_Module *mod, int ndx,
>      }
>  
>    GElf_Word shndx;
> -  sym = gelf_getsymshndx (mod->symdata, mod->symxndxdata, ndx, sym, &shndx);
> +  if ((size_t) ndx < mod->syments)
> +    sym = gelf_getsymshndx (mod->symdata, mod->symxndxdata, ndx, sym, &shndx);
> +  else if (mod->aux_symdata != NULL)
> +    sym = gelf_getsymshndx (mod->aux_symdata, mod->aux_symxndxdata,
> +			    ndx - mod->syments, sym, &shndx);

This violates ELF standard for the application callers of dwfl_module_getsym:
	In each symbol table, all symbols with STB_LOCAL binding precede the
	weak and global symbols.

As long as the dwfl_module_getsym interface represents a single symbol table
which seems so according to its description:
	Fetch one entry from the module's symbol table.



Regards,
Jan

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]