From 37ddf6e5fa1530adc3a7236379a3a88dfef33d53 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sun, 29 Jun 2008 10:14:19 -0400 Subject: STP_RELOCATE message for kernel relocatability (re)adaption, starting implementation --- runtime/sym.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'runtime/sym.c') 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; isymbol) == 0) + return s->addr; + s++; } return 0; } -- cgit