Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] x86_64: allow unwinder to build without module support

Add proper conditionals to be able to build with CONFIG_MODULES=n.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Jan Beulich and committed by
Linus Torvalds
83f4fcce c33bd9aa

+12
+8
include/linux/unwind.h
··· 29 29 */ 30 30 extern void unwind_init(void); 31 31 32 + #ifdef CONFIG_MODULES 33 + 32 34 extern void *unwind_add_table(struct module *, 33 35 const void *table_start, 34 36 unsigned long table_size); 35 37 36 38 extern void unwind_remove_table(void *handle, int init_only); 39 + 40 + #endif 37 41 38 42 extern int unwind_init_frame_info(struct unwind_frame_info *, 39 43 struct task_struct *, ··· 76 72 77 73 static inline void unwind_init(void) {} 78 74 75 + #ifdef CONFIG_MODULES 76 + 79 77 static inline void *unwind_add_table(struct module *mod, 80 78 const void *table_start, 81 79 unsigned long table_size) 82 80 { 83 81 return NULL; 84 82 } 83 + 84 + #endif 85 85 86 86 static inline void unwind_remove_table(void *handle, int init_only) 87 87 {
+4
kernel/unwind.c
··· 172 172 __start_unwind, __end_unwind - __start_unwind); 173 173 } 174 174 175 + #ifdef CONFIG_MODULES 176 + 175 177 /* Must be called with module_mutex held. */ 176 178 void *unwind_add_table(struct module *module, 177 179 const void *table_start, ··· 254 252 if (info.table) 255 253 kfree(table); 256 254 } 255 + 256 + #endif /* CONFIG_MODULES */ 257 257 258 258 static uleb128_t get_uleb128(const u8 **pcur, const u8 *end) 259 259 {