summaryrefslogtreecommitdiffstats
path: root/dwflpp.cxx
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-11-16 21:34:00 +0100
committerMark Wielaard <mjw@redhat.com>2009-11-16 21:34:00 +0100
commita295050e60affe0bb55fc2d46637314c0822f35d (patch)
tree51f6a7cf590e5da3ee2a12faa2643c5fabdba2cd /dwflpp.cxx
parent01a71905151a751fc81a5f58743f6915378be20a (diff)
downloadsystemtap-steved-a295050e60affe0bb55fc2d46637314c0822f35d.tar.gz
systemtap-steved-a295050e60affe0bb55fc2d46637314c0822f35d.tar.xz
systemtap-steved-a295050e60affe0bb55fc2d46637314c0822f35d.zip
PR10010 Support $globals in shared libraries.
* dwflpp.cxx (dwflpp::emit_address): Enable task finder and emit a _stp_module_relocate for the ".dynamic" section when seeing a user-space dso address. * runtime/sym.c (_stp_mod_sec_lookup): Remove .dynamic section addr cheat. (_stp_tf_mmap_cb): Add cheat here.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r--dwflpp.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/dwflpp.cxx b/dwflpp.cxx
index 92fe04c1..35637568 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -1502,12 +1502,11 @@ dwflpp::emit_address (struct obstack *pool, Dwarf_Addr address)
}
else
{
- throw semantic_error ("cannot relocate user-space dso (?) address");
-#if 0
- // This would happen for a Dwfl_Module that's a user-level DSO.
- obstack_printf (pool, " /* %s+%#" PRIx64 " */",
- modname, address);
-#endif
+ enable_task_finder (sess);
+ obstack_printf (pool, "({ static unsigned long addr = 0; ");
+ obstack_printf (pool, "if (addr==0) addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ",
+ modname, ".dynamic", reloc_address);
+ obstack_printf (pool, "addr; })");
}
}
else