From 432f054fc20511d487d18234b6408b5df89a8c4d Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 27 Mar 2009 11:54:42 -0400 Subject: PR10000: emit _stp_relocate* calculations correctly for kernel/module global $data * translate.cxx (dump_unwindsyms): Also emit STT_OBJECT symbols, therefore .data etc. sections into stap-symbols.h. * tapsets.cxx (iterate_over_modules): Omit a dwfl_getmodules() RC-checking assertion that blocked meaningful $context var error messages. (dwflpp::emit_address): Bypass dwfl_module_relocate_address() for kernel symbols as it has been unreliable; subtract sess.sym_stext manually. * testsuite/buildok/seventeen.stp: Extend test with module $global. --- translate.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'translate.cxx') diff --git a/translate.cxx b/translate.cxx index 0b81d9bb..47fffd1e 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4564,7 +4564,7 @@ dump_unwindsyms (Dwfl_Module *m, // base address outself. (see also below). extra_offset = sym.st_value - base; if (c->session.verbose > 2) - clog << "Found kernel _stext 0x" << hex << extra_offset << dec << endl; + clog << "Found kernel _stext extra offset 0x" << hex << extra_offset << dec << endl; } // We only need the function symbols to identify kernel-mode @@ -4572,8 +4572,9 @@ dump_unwindsyms (Dwfl_Module *m, // These fake absolute addresses occur in some older i386 // kernels to indicate they are vDSO symbols, not real // functions in the kernel. - if (GELF_ST_TYPE (sym.st_info) == STT_FUNC && - ! (sym.st_shndx == SHN_UNDEF || sym.st_shndx == SHN_ABS)) + if ((GELF_ST_TYPE (sym.st_info) == STT_FUNC || + GELF_ST_TYPE (sym.st_info) == STT_OBJECT) // PR10000: also need .data + && !(sym.st_shndx == SHN_UNDEF || sym.st_shndx == SHN_ABS)) { Dwarf_Addr sym_addr = sym.st_value; const char *secname = NULL; -- cgit