summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorfche <fche>2008-02-12 21:25:42 +0000
committerfche <fche>2008-02-12 21:25:42 +0000
commit21beacc9a00ea48763048151c370e205c5f23379 (patch)
tree03ed2e7f5407cd7445154426ae212f411a928e11 /tapsets.cxx
parent4c52f88eefaf2d39be9c937d00389dd123609a41 (diff)
downloadsystemtap-steved-21beacc9a00ea48763048151c370e205c5f23379.tar.gz
systemtap-steved-21beacc9a00ea48763048151c370e205c5f23379.tar.xz
systemtap-steved-21beacc9a00ea48763048151c370e205c5f23379.zip
PR4393: fix relocatable-kernel global $variable access
2008-02-12 Frank Ch. Eigler <fche@elastic.org> PR 4393 * tapsets.cxx (emit_address): Support relocatable kernels. (dwarf_derived_probe ctor): Hack around for missing USHRT_MAX. * elaborate.cxx (semantic_pass): Increment rc if exception caught. 2008-02-12 Frank Ch. Eigler <fche@elastic.org> * systemtap.pass1-4/buildok.exp: No longer kfail buildok/seventeen.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 540b3bc4..9fbad6bb 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -1365,6 +1365,17 @@ struct dwflpp
modname, secname, address);
obstack_printf (pool, "addr; })");
}
+ else if (n == 1 && module_name == TOK_KERNEL && secname[0] == '\0')
+ {
+ // elfutils' way of telling us that this is a relocatable kernel address, which we
+ // need to treat the same way here as dwarf_query::add_probe_point does: _stext.
+ address -= sess.sym_stext;
+ secname = "_stext";
+ obstack_printf (pool, "({ static unsigned long addr = 0; ");
+ obstack_printf (pool, "if (addr==0) addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ",
+ modname, secname, address);
+ obstack_printf (pool, "addr; })");
+ }
else
{
throw semantic_error ("cannot relocate user-space dso (?) address");
@@ -3649,6 +3660,11 @@ dwarf_derived_probe::dwarf_derived_probe(const string& funcname,
this->tok = q.base_probe->tok;
+ // XXX: hack for strange g++/gcc's
+#ifndef USHRT_MAX
+#define USHRT_MAX 32767
+#endif
+
// Range limit maxactive() value
if (q.has_maxactive && (q.maxactive_val < 0 || q.maxactive_val > USHRT_MAX))
throw semantic_error ("maxactive value out of range [0,"