diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-06-29 10:14:19 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-06-29 10:14:19 -0400 |
commit | 37ddf6e5fa1530adc3a7236379a3a88dfef33d53 (patch) | |
tree | ad7c05df8b0ebeafa75cfee1ed569bf2722091e2 /runtime/sym.c | |
parent | 53ca410a6a6032c2cde6aac6e95b57c68585e48a (diff) | |
download | systemtap-steved-37ddf6e5fa1530adc3a7236379a3a88dfef33d53.tar.gz systemtap-steved-37ddf6e5fa1530adc3a7236379a3a88dfef33d53.tar.xz systemtap-steved-37ddf6e5fa1530adc3a7236379a3a88dfef33d53.zip |
STP_RELOCATE message for kernel relocatability (re)adaption, starting implementation
Diffstat (limited to 'runtime/sym.c')
-rw-r--r-- | runtime/sym.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/runtime/sym.c b/runtime/sym.c index 7163bf92..eca54a35 100644 --- a/runtime/sym.c +++ b/runtime/sym.c @@ -59,6 +59,8 @@ unsigned long _stp_module_relocate(const char *module, const char *section, unsi /* See also transport/symbols.c (_stp_do_symbols). */ if (strcmp(section, "_stext")) return 0; + else if (_stp_modules[0]->text == 0) /* kernel->text unavailable? STP_RELOCATE */ + return 0; else return offset + _stp_modules[0]->text; } else { @@ -88,11 +90,12 @@ static unsigned long _stp_kallsyms_lookup_name(const char *name) { struct _stp_symbol *s = _stp_modules[0]->symbols; unsigned num = _stp_modules[0]->num_symbols; + unsigned i; - while (num--) { - if (strcmp(name, s->symbol) == 0) - return s->addr; - s++; + for (i=0; i<num; i++, s++) { + if (strcmp(name, s->symbol) == 0) + return s->addr; + s++; } return 0; } |