Skip to contentSkip to conversation

/proc/kallsyms

PATCH New Rusty Russell 1 participant 1 message Apr 15, 2003 Module support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 /proc/kallsyms

This allows access to kallsyms through /proc.

Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

Name: kallsyms in proc
Author: Rusty Russell
Status: Tested on 2.5.67-bk5

D: This adds a /proc/kallsyms if you have CONFIG_KALLSYMS in your
D: kernel. The output is nm-like, with symbols in caps (global) if
D: exported using EXPORT_SYMBOL, rather than the normal static
D: vs. non-static differntiation.

include/linux/module.h +20 -0
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.67-bk5/include/linux/module.h working-2.5.67-bk5-kallsyms/include/linux/module.h
@@ -253,6 +253,13 @@ static inline int module_is_live(struct 
 /* Is this address in a module? */
 struct module *module_text_address(unsigned long addr);
 
+/* Returns module and fills in value, defined and namebuf, or NULL if
+   symnum out of range. */
+struct module *module_get_kallsym(unsigned int symnum,
+				  unsigned long *value,
+				  char *type,
+				  char namebuf[128]);
+int is_exported(const char *name, const struct module *mod);
 #ifdef CONFIG_MODULE_UNLOAD
 
 void __symbol_put(const char *symbol);
@@ -379,6 +386,19 @@ static inline const char *module_address
 	return NULL;
 }
 
+static inline struct module *module_get_kallsym(unsigned int symnum,
+						unsigned long *value,
+						char *type,
+						char namebuf[128])
+{
+	return NULL;
+}
+
+static inline int is_exported(const char *name, const struct module *mod)
+{
+	return 0;
+}
+
 static inline int register_module_notifier(struct notifier_block * nb)
 {
 	/* no events will happen anyway, so this can always succeed */
kernel/kallsyms.c +162 -0

173 lines not on this page · raw message

kernel/module.c +103 -5

130 lines not on this page · raw message