]> sourceware.org Git - systemtap.git/commitdiff
2006-11-03 Frank Ch. Eigler <fche@elastic.org>
authorfche <fche>
Fri, 3 Nov 2006 23:34:28 +0000 (23:34 +0000)
committerfche <fche>
Fri, 3 Nov 2006 23:34:28 +0000 (23:34 +0000)
* tapsets.cxx (emit_address): Emit calls to _stp_module_relocate
for $target-variable addresses in relocatable sections.

ChangeLog
tapsets.cxx

index f19ce0ba52b90fbcd6ad1f14b2ed3754211b1bf2..ccfaa9424ba655ecf4c6ab93ff88edee297456d9 100644 (file)
--- 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 
index dc0fc3c1c6355e95179775c9d71f74360ddf206d..472b0ab36d7de0cc84562c84fb9f964fb43e3052 100644 (file)
@@ -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,
This page took 0.050142 seconds and 5 git commands to generate.