aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/module_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/module_64.c')
-rw-r--r--arch/powerpc/kernel/module_64.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c
index 8dd1f0aae5d6..75c7c4f19280 100644
--- a/arch/powerpc/kernel/module_64.c
+++ b/arch/powerpc/kernel/module_64.c
@@ -20,6 +20,7 @@
20#include <linux/moduleloader.h> 20#include <linux/moduleloader.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/vmalloc.h> 22#include <linux/vmalloc.h>
23#include <linux/bug.h>
23#include <asm/module.h> 24#include <asm/module.h>
24#include <asm/uaccess.h> 25#include <asm/uaccess.h>
25#include <asm/firmware.h> 26#include <asm/firmware.h>
@@ -439,23 +440,11 @@ int module_finalize(const Elf_Ehdr *hdr,
439 const Elf_Shdr *sechdrs, struct module *me) 440 const Elf_Shdr *sechdrs, struct module *me)
440{ 441{
441 const Elf_Shdr *sect; 442 const Elf_Shdr *sect;
443 int err;
442 444
443 me->arch.bug_table = NULL; 445 err = module_bug_finalize(hdr, sechdrs, me);
444 me->arch.num_bugs = 0; 446 if (err)
445 447 return err;
446 /* Find the __bug_table section, if present */
447 sect = find_section(hdr, sechdrs, "__bug_table");
448 if (sect != NULL) {
449 me->arch.bug_table = (void *) sect->sh_addr;
450 me->arch.num_bugs = sect->sh_size / sizeof(struct bug_entry);
451 }
452
453 /*
454 * Strictly speaking this should have a spinlock to protect against
455 * traversals, but since we only traverse on BUG()s, a spinlock
456 * could potentially lead to deadlock and thus be counter-productive.
457 */
458 list_add(&me->arch.bug_list, &module_bug_list);
459 448
460 /* Apply feature fixups */ 449 /* Apply feature fixups */
461 sect = find_section(hdr, sechdrs, "__ftr_fixup"); 450 sect = find_section(hdr, sechdrs, "__ftr_fixup");
@@ -475,7 +464,7 @@ int module_finalize(const Elf_Ehdr *hdr,
475 464
476void module_arch_cleanup(struct module *mod) 465void module_arch_cleanup(struct module *mod)
477{ 466{
478 list_del(&mod->arch.bug_list); 467 module_bug_cleanup(mod);
479} 468}
480 469
481struct bug_entry *module_find_bug(unsigned long bugaddr) 470struct bug_entry *module_find_bug(unsigned long bugaddr)