[patchv3 4/4] Provide virtual symbols for ppc64 function descriptors

Mark Wielaard mjw at redhat.com
Thu Nov 14 13:42:34 UTC 2013


Hi Jan,

On Wed, 2013-11-13 at 20:46 +0100, Jan Kratochvil wrote:
> commit cbfa801a935c078bab41b85fc024d4028a84cfe8
> Author: Jan Kratochvil <jan.kratochvil at redhat.com>
> Date:   Wed Nov 6 20:38:05 2013 +0100
> 
>     Provide virtual symbols for ppc64 function descriptors

This really needs a more high-level description of the approach taken.
Not knowing the design up front makes reviewing the code harder.

Could you review my understanding so far and point out where I might
have misunderstood the approach or ask silly questions?

As far as I understand from skimming the code, you want to provide an
(extra) table of (function) symbols from ebl for the elf file it is
backing. These symbols are matched against the .odp (in this ppc64 case)
section data.

Could you please add a little (high-level) description of the ppc64 .odp
section data and how it relates to the symbol table data?

For each symbol, in the original elf file symbol table, whose st_value
points to an .odp entry, you store a new derived symbol with an adjust
value, name, the original shndx and file (different from elf?). For this
you do need to walk the original symbol table twice on initialization.

You don't directly read the symbol table (using for example
gelf_getsymshndx), but use a callback for that in the ebl hook. Why is
that?

>     backends/
>     2013-11-13  Jan Kratochvil  <jan.kratochvil at redhat.com>
>     
>     	Provide virtual symbols for ppc64 function descriptors.
>     	* Makefile.am (ppc64_SRCS): Add ppc64_get_symbol.c.
>     	* ppc64_get_symbol.c: New file.
>     	* ppc64_init.c (ppc64_init): Install init_symbols, get_symbol and
>     	destr.

BTW. Missing separator libdwfl/ here.

>     	* dwfl_module_addrsym.c (dwfl_module_addrsym): Adjust FIRST_GLOBAL also
>     	for EBL_FIRST_GLOBAL.
>     	* dwfl_module_getdwarf.c (getsym_helper): New function.
>     	(find_symtab): Call also ebl_init_symbols.
>     	(dwfl_module_getsymtab): Count also EBL_SYMENTS.
>     	* dwfl_module_getsym.c (__libdwfl_module_getsym): Count also
>     	EBL_FIRST_GLOBAL, EBL_SYMENTS.  Call also ebl_get_symbol.
>     	* libdwflP.h (DWFL_ERRORS): Add INVALID_INDEX.
>     	(struct Dwfl_Module): Add fields ebl_syments and ebl_first_global.
>     
>     libebl/
>     2013-11-06  Jan Kratochvil  <jan.kratochvil at redhat.com>
>     
>     	Provide virtual symbols for ppc64 function descriptors.
>     	* Makefile.am (gen_SOURCES): Add eblgetsymbol.c.
>     	* ebl-hooks.h (init_symbols, get_symbol): New.
>     	* eblgetsymbol.c: New file.
>     	* libebl.h (ebl_getsym_t): New definition.
>     	(ebl_init_symbols, ebl_get_symbol): New declarations.
>     	* libeblP.h (struct ebl): New field backend.
>     
>     tests/
>     2013-11-06  Jan Kratochvil  <jan.kratochvil at redhat.com>
>     
>     	Provide virtual symbols for ppc64 function descriptors.
>     	* Makefile.am (EXTRA_DIST): Add testfile66.bz2.
>     	* run-addrname-test.sh (testfile66): New test.
>     	* testfile66.bz2: New file.

BTW2. Please do send patches through git send-email or git format-patch
so they can be more easily applied locally and binaries come through
encoded and not just as Binary files /dev/null and
b/tests/testfile66.bz2 differ. The git branch was useful to find this
though.

Thanks,

Mark




More information about the elfutils-devel mailing list