summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-03-27 11:54:42 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-03-27 11:55:02 -0400
commit432f054fc20511d487d18234b6408b5df89a8c4d (patch)
treed2cd351411510383056b42dafbf266bd270e4c04 /translate.cxx
parent0977ab1f283c48918c483a73d96b1345286419ca (diff)
downloadsystemtap-steved-432f054fc20511d487d18234b6408b5df89a8c4d.tar.gz
systemtap-steved-432f054fc20511d487d18234b6408b5df89a8c4d.tar.xz
systemtap-steved-432f054fc20511d487d18234b6408b5df89a8c4d.zip
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.
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx7
1 files changed, 4 insertions, 3 deletions
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;