libdwfl: Introduce dwfl_module_getsym_info and dwfl_module_addrinfo.
authorMark Wielaard <mjw@redhat.com>
Wed, 18 Dec 2013 10:05:54 +0000 (11:05 +0100)
committerMark Wielaard <mjw@redhat.com>
Fri, 20 Dec 2013 09:09:49 +0000 (10:09 +0100)
commit159ac52b061c60947a943c102298cd692223274f
treed3d3a07d249704f95424072064e160df4ae4c156
parent565149d564cfe9da3b5cd94c9387ee0473d0704a
libdwfl: Introduce dwfl_module_getsym_info and dwfl_module_addrinfo.

Some arches like ppc64 use function descriptor values instead of function
addresses causing matching of names and addresses to fail when using
dwfl_module_getsym or dwfl_module_addrsym.

Add ebl hook to resolve any function descriptor values found in non-ET_REL
modules.

The new function dwfl_module_getsym_info doesn't adjust the symbol value
in any way, but returns the adjusted and/or resolved address associated
with the symbol separately. The new function dwfl_module_addrinfo resolves
against both the address associated with the symbol (which could be the
function entry address) value and the adjusted st_value. So that it is
easy to resolve and match either function descriptors and/or function
entry addresses.

Since these new functions also return more information they replace the
dwfl_module_getsym_elf and dwfl_module_addrsym_elf functions that never
made it into a released elfutils version.

addr2line and readelf now use the new functions when looking up functions
names. addr2line will now also display the section the address was found
in when given -x.

Extra testcases were added for both addr2line and the dwflsyms testscase.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
41 files changed:
ChangeLog
NEWS
backends/ChangeLog
backends/Makefile.am
backends/ppc64_init.c
backends/ppc64_resolve_sym.c [new file with mode: 0644]
libdw/ChangeLog
libdw/libdw.map
libdwfl/ChangeLog
libdwfl/derelocate.c
libdwfl/dwfl_module_addrname.c
libdwfl/dwfl_module_addrsym.c
libdwfl/dwfl_module_getsym.c
libdwfl/libdwfl.h
libdwfl/libdwflP.h
libebl/ChangeLog
libebl/Makefile.am
libebl/ebl-hooks.h
libebl/eblresolvesym.c [new file with mode: 0644]
libebl/libebl.h
libebl/libeblP.h
src/ChangeLog
src/addr2line.c
src/readelf.c
tests/ChangeLog
tests/Makefile.am
tests/dwflsyms.c
tests/run-addrname-test.sh
tests/run-dwflsyms.sh
tests/testfile66.bz2 [new file with mode: 0755]
tests/testfile66.core.bz2 [new file with mode: 0644]
tests/testfilebazdbgppc64.bz2 [new file with mode: 0755]
tests/testfilebazdbgppc64.debug.bz2 [new file with mode: 0755]
tests/testfilebazdbgppc64_pl.bz2 [new file with mode: 0755]
tests/testfilebazdbgppc64_plr.bz2 [new file with mode: 0755]
tests/testfilebazdynppc64.bz2 [new file with mode: 0755]
tests/testfilebazmdbppc64.bz2 [new file with mode: 0755]
tests/testfilebazminppc64.bz2 [new file with mode: 0755]
tests/testfilebazminppc64_pl.bz2 [new file with mode: 0755]
tests/testfilebazminppc64_plr.bz2 [new file with mode: 0755]
tests/testfilebaztabppc64.bz2 [new file with mode: 0755]