diff options
Diffstat (limited to 'arch/powerpc/kernel/module_32.c')
-rw-r--r-- | arch/powerpc/kernel/module_32.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c index e2c3c6a85f33..8339fd609de0 100644 --- a/arch/powerpc/kernel/module_32.c +++ b/arch/powerpc/kernel/module_32.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/string.h> | 23 | #include <linux/string.h> |
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/cache.h> | 25 | #include <linux/cache.h> |
26 | #include <linux/bug.h> | ||
26 | 27 | ||
27 | #include "setup.h" | 28 | #include "setup.h" |
28 | 29 | ||
@@ -290,23 +291,11 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
290 | struct module *me) | 291 | struct module *me) |
291 | { | 292 | { |
292 | const Elf_Shdr *sect; | 293 | const Elf_Shdr *sect; |
294 | int err; | ||
293 | 295 | ||
294 | me->arch.bug_table = NULL; | 296 | err = module_bug_finalize(hdr, sechdrs, me); |
295 | me->arch.num_bugs = 0; | 297 | if (err) /* never true, currently */ |
296 | 298 | return err; | |
297 | /* Find the __bug_table section, if present */ | ||
298 | sect = find_section(hdr, sechdrs, "__bug_table"); | ||
299 | if (sect != NULL) { | ||
300 | me->arch.bug_table = (void *) sect->sh_addr; | ||
301 | me->arch.num_bugs = sect->sh_size / sizeof(struct bug_entry); | ||
302 | } | ||
303 | |||
304 | /* | ||
305 | * Strictly speaking this should have a spinlock to protect against | ||
306 | * traversals, but since we only traverse on BUG()s, a spinlock | ||
307 | * could potentially lead to deadlock and thus be counter-productive. | ||
308 | */ | ||
309 | list_add(&me->arch.bug_list, &module_bug_list); | ||
310 | 299 | ||
311 | /* Apply feature fixups */ | 300 | /* Apply feature fixups */ |
312 | sect = find_section(hdr, sechdrs, "__ftr_fixup"); | 301 | sect = find_section(hdr, sechdrs, "__ftr_fixup"); |
@@ -320,7 +309,7 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
320 | 309 | ||
321 | void module_arch_cleanup(struct module *mod) | 310 | void module_arch_cleanup(struct module *mod) |
322 | { | 311 | { |
323 | list_del(&mod->arch.bug_list); | 312 | module_bug_cleanup(mod); |
324 | } | 313 | } |
325 | 314 | ||
326 | struct bug_entry *module_find_bug(unsigned long bugaddr) | 315 | struct bug_entry *module_find_bug(unsigned long bugaddr) |