summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfche <fche>2006-11-03 23:34:28 +0000
committerfche <fche>2006-11-03 23:34:28 +0000
commite664cf5b5c1d7d75aabacbd8eb84669bc96af5d5 (patch)
tree0f3ae0862ac041c7b39bd20cc590c3c16add6784
parent5c93519b3dfffc1b8998798c04007afa7912ae9f (diff)
downloadsystemtap-steved-e664cf5b5c1d7d75aabacbd8eb84669bc96af5d5.tar.gz
systemtap-steved-e664cf5b5c1d7d75aabacbd8eb84669bc96af5d5.tar.xz
systemtap-steved-e664cf5b5c1d7d75aabacbd8eb84669bc96af5d5.zip
2006-11-03 Frank Ch. Eigler <fche@elastic.org>
* tapsets.cxx (emit_address): Emit calls to _stp_module_relocate for $target-variable addresses in relocatable sections.
-rw-r--r--ChangeLog5
-rw-r--r--tapsets.cxx24
2 files changed, 23 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f19ce0ba..ccfaa942 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-03 Frank Ch. Eigler <fche@elastic.org>
+
+ * tapsets.cxx (emit_address): Emit calls to _stp_module_relocate
+ for $target-variable addresses in relocatable sections.
+
2006-11-02 Martin Hunt <hunt@redhat.com>
* session.h (struct systemtap_session): Add symtab. This controls
diff --git a/tapsets.cxx b/tapsets.cxx
index dc0fc3c1..472b0ab3 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -1232,10 +1232,15 @@ struct dwflpp
throw semantic_error (msg);
}
+ // This function generates code used for addressing computations of
+ // target variables.
void emit_address (struct obstack *pool, Dwarf_Addr address)
{
- // For now what we actually use is just a hard-wired constant.
+ #if 0
+ // The easy but incorrect way is to just print a hard-wired
+ // constant.
obstack_printf (pool, "%#" PRIx64 "UL", address);
+ #endif
// Turn this address into a section-relative offset if it should be one.
// We emit a comment approximating the variable+offset expression that
@@ -1256,13 +1261,20 @@ struct dwflpp
if (n > 1 || secname[0] != '\0')
// This gives us the module name, and section name within the
// module, for a kernel module (or other ET_REL module object).
- obstack_printf (pool, " /* %s(%s)+%#" PRIx64 " */",
- modname, secname, address);
+ obstack_printf (pool, " _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 ")",
+ modname, secname, address);
else
- // This would happen for a Dwfl_Module that's a user-level DSO.
- obstack_printf (pool, " /* %s+%#" PRIx64 " */",
- modname, address);
+ {
+ 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
+ }
}
+ else
+ obstack_printf (pool, "%#" PRIx64 "UL", address); // assume as constant
}
static void loc2c_emit_address (void *arg, struct obstack *pool,