diff options
| author | Mark Wielaard <[email protected]> | 2013-12-18 11:05:54 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2013-12-20 10:09:49 +0100 |
| commit | 159ac52b061c60947a943c102298cd692223274f (patch) | |
| tree | d3d3a07d249704f95424072064e160df4ae4c156 /tests/run-addrname-test.sh | |
| parent | 565149d564cfe9da3b5cd94c9387ee0473d0704a (diff) | |
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 <[email protected]>
Diffstat (limited to 'tests/run-addrname-test.sh')
| -rwxr-xr-x | tests/run-addrname-test.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/run-addrname-test.sh b/tests/run-addrname-test.sh index 8624074f..f954ee45 100755 --- a/tests/run-addrname-test.sh +++ b/tests/run-addrname-test.sh @@ -298,6 +298,41 @@ __vdso_time ??:0 EOF +# .section ".text" +# .globl _start +# .section ".opd","aw" +#_start: .quad .L._start,.TOC.@tocbase +# .previous +# .type _start, @function +#.L._start: +# .byte 0x7d, 0x82, 0x10, 0x08 +# .size _start,.-.L._start +testfiles testfile66 testfile66.core +testrun_compare ${abs_top_builddir}/src/addr2line -x -e testfile66 _start 0x2d8 0x2db 0x2dc 0x103d0 0x103d3 0x103d4<<EOF +_start (.text) +??:0 +_start (.text) +??:0 +_start+0x3 (.text) +??:0 +()+0x2dc +??:0 +_start (.opd) +??:0 +_start+0x3 (.opd) +??:0 +()+0x103d4 +??:0 +EOF +testrun_compare ${abs_top_builddir}/src/addr2line -x -e testfile66 --core=testfile66.core _start 0x461b02d8 0x461c03d0<<\EOF +_start (.text) +??:0 +_start (.text) +??:0 +_start (.opd) +??:0 +EOF + testfiles testfile69.core testfile69.so testrun_compare ${abs_top_builddir}/src/addr2line --core=./testfile69.core -S 0x7f0bc6a33535 0x7f0bc6a33546 <<\EOF libstatic+0x9 |
