diff options
| author | Mark Wielaard <[email protected]> | 2013-11-16 00:11:38 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2013-11-16 00:25:33 +0100 |
| commit | 68ce4fc85bbf95441e96fedd76c8bd78f76d8da2 (patch) | |
| tree | 43e289a7ae1b705e25c9fbf9ba429afb516be1cb /tests/dwflsyms.c | |
| parent | e31e73969793e5e1f9ee4a9ae2d266f5e6ca435d (diff) | |
tests: Fix broken dwflsyms tests, extend test and add prelink tests.
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 <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'tests/dwflsyms.c')
| -rw-r--r-- | tests/dwflsyms.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/dwflsyms.c b/tests/dwflsyms.c index cae3fbea..55f2653c 100644 --- a/tests/dwflsyms.c +++ b/tests/dwflsyms.c @@ -83,7 +83,7 @@ list_syms (struct Dwfl_Module *mod, GElf_Sym sym; GElf_Word shndxp; const char *name = dwfl_module_getsym (mod, ndx, &sym, &shndxp); - printf("%4d: %s\t%s\t%s (%" PRIu64 ") %#" PRIx64 "\n", + printf("%4d: %s\t%s\t%s (%" PRIu64 ") %#" PRIx64, ndx, gelf_type (&sym), gelf_bind (&sym), name, sym.st_size, sym.st_value); @@ -97,7 +97,12 @@ list_syms (struct Dwfl_Module *mod, GElf_Word ashndxp; const char *aname = dwfl_module_addrsym (mod, addr, &asym, &ashndxp); assert (strcmp (name, aname) == 0); + + int res = dwfl_module_relocate_address (mod, &addr); + assert (res != -1); + printf(", rel: %#" PRIx64 "", addr); } + printf ("\n"); } return DWARF_CB_OK; |
