summaryrefslogtreecommitdiffstats
path: root/runtime/sym.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/sym.c')
-rw-r--r--runtime/sym.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/runtime/sym.c b/runtime/sym.c
index 0baa1a5e..fd9863dd 100644
--- a/runtime/sym.c
+++ b/runtime/sym.c
@@ -45,6 +45,22 @@ static int _stp_tf_mmap_cb(struct stap_task_finder_target *tgt,
path);
#endif
module = _stp_modules[i];
+ // cheat...
+ // We are abusing the "first" section address
+ // here to indicate where the module (actually
+ // first segment) is loaded (which is why we
+ // are ignoring the offset). It would be good
+ // to redesign the stp_module/stp_section
+ // data structures to better align with the
+ // actual memory mappings we are interested
+ // in (especially the "section" naming is
+ // slightly confusing since what we really
+ // seem to mean are elf segments (which can
+ // contain multiple elf sections).
+ if ((strcmp(".dynamic",
+ module->sections[0].name) == 0)
+ && module->sections[0].addr == 0)
+ module->sections[0].addr = addr;
break;
}
}
@@ -138,8 +154,6 @@ static struct _stp_module *_stp_mod_sec_lookup(unsigned long addr,
*sec = &m->sections[0]; // XXX check actual section and relocate
dbug_sym(1, "found section %s in module %s at 0x%lx\n",
m->sections[0].name, m->name, vm_start);
- if (strcmp(".dynamic", m->sections[0].name) == 0)
- m->sections[0].addr = vm_start; // cheat...
return m;
}
}