summaryrefslogtreecommitdiff
path: root/tests/dwflsyms.c
Commit message (Collapse)AuthorAgeFilesLines
* libdwfl: Introduce dwfl_module_getsym_info and dwfl_module_addrinfo.Mark Wielaard2013-12-201-10/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* libdwfl: Add dwfl_module_addrsym_elf and dwfl_module_getsym_elf.Mark Wielaard2013-11-271-4/+62
| | | | | | | | | | | Introduce two new functions that also return the elf associated with a symbol to make symbol section indexing work for non-special sections. Simplify code by removing dwfl_file where appropriate and just track Elf directly. Document limitations of shndx with existing dwfl_module_addrsym and dwfl_module_getsym. Extend dwflsyms testcase to check some more symbol and section (index) properties. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Fix broken dwflsyms tests, extend test and add prelink tests.Mark Wielaard2013-11-161-1/+6
| | | | | | | | | | | The two test files that contains minisymtab tables and the expected test output were wrongly generated. Also prelink tests were missing to check that a prelinked main ELF file with separate debug or minisyms generated correctly adjusted symbol values. The dwflsyms test was also extended to check print and check the result of dwfl_module_relocate_address. Reported-by: Josh Stone <jistone@redhat.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: readelf --elf-section, dwfl_module_addrsym and dwfl_module_getsym.Mark Wielaard2013-01-221-0/+124
Various tests for the new minisymtab support. Signed-off-by: Mark Wielaard <mjw@redhat.com>