Skip to contentSkip to conversation

Richard Henderson for President!

PATCH New Rusty Russell 1 participant 1 message Jan 17, 2003 Module support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Richard Henderson for President!

Linus, please apply. Makes symbol_get work if !CONFIG_MODULE.

Name: symbol_get fix
Author: Rusty Russell
Status: Trivial

D: Make symbol_get() use undefined weak symbols if !CONFIG_MODULE.
D: Many thanks to RTH for introducing undef weak symbols to me.

include/linux/module.h +1 -1
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .932-linux-2.5-bk/include/linux/module.h .932-linux-2.5-bk.updated/include/linux/module.h
@@ -344,7 +344,7 @@ static inline int module_text_address(un
 }
 
 /* Get/put a kernel symbol (calls should be symmetric) */
-#define symbol_get(x) (&(x))
+#define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
 #define symbol_put(x) do { } while(0)
 #define symbol_put_addr(x) do { } while(0)
 

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