summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-02-26 06:44:18 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-02-26 06:44:18 -0800
commitf46981b2737d93cf4b88f8101c458d12804b42ea (patch)
tree31c2e2ebf0221dc24764896666a367be50ff6c57 /include/linux
parentef2dbb549121b2d41e2350ea5e8ed9981f23bf27 (diff)
[PATCH] Add kallsyms_lookupname()
From: Rusty Russell <rusty@au1.ibm.com> Attached patch adds a kallsyms_lookupname() function for lookups of a symbol name to an address. Debuggers such as ppc[64] xmon can use this. It's intentionally not exported as a symbol for module use, since it can be used to circumvent other symbol export restrictions.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/kallsyms.h8
-rw-r--r--include/linux/module.h9
2 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index d2a90b7766a1..87b9bbbb485e 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -8,6 +8,9 @@
#include <linux/config.h>
#ifdef CONFIG_KALLSYMS
+/* Lookup the address for a symbol. Returns 0 if not found. */
+unsigned long kallsyms_lookup_name(const char *name);
+
/* Lookup an address. modname is set to NULL if it's in the kernel. */
const char *kallsyms_lookup(unsigned long addr,
unsigned long *symbolsize,
@@ -19,6 +22,11 @@ extern void __print_symbol(const char *fmt, unsigned long address);
#else /* !CONFIG_KALLSYMS */
+static inline unsigned long kallsyms_lookup_name(const char *name)
+{
+ return 0;
+}
+
static inline const char *kallsyms_lookup(unsigned long addr,
unsigned long *symbolsize,
unsigned long *offset,
diff --git a/include/linux/module.h b/include/linux/module.h
index 95cbc9b4936f..e01784890022 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -282,6 +282,10 @@ struct module *module_get_kallsym(unsigned int symnum,
unsigned long *value,
char *type,
char namebuf[128]);
+
+/* Look for this name: can be of form module:name. */
+unsigned long module_kallsyms_lookup_name(const char *name);
+
int is_exported(const char *name, const struct module *mod);
extern void __module_put_and_exit(struct module *mod, long code)
@@ -434,6 +438,11 @@ static inline struct module *module_get_kallsym(unsigned int symnum,
return NULL;
}
+static inline unsigned long module_kallsyms_lookup_name(const char *name)
+{
+ return 0;
+}
+
static inline int is_exported(const char *name, const struct module *mod)
{
return 0;