Committer: Michael Beasley <mike@snafu.setup>
[mikesnafu-overlay.git] / arch / frv / kernel / module.c
blob850d168f69fc553b9cfc51ae3abe6122067ac8da
1 /* module.c: FRV specific module loading bits
3 * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 * - Derived from arch/i386/kernel/module.c, Copyright (C) 2001 Rusty Russell.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
12 #include <linux/moduleloader.h>
13 #include <linux/elf.h>
14 #include <linux/vmalloc.h>
15 #include <linux/fs.h>
16 #include <linux/string.h>
17 #include <linux/kernel.h>
19 #if 0
20 #define DEBUGP printk
21 #else
22 #define DEBUGP(fmt...)
23 #endif
25 void *module_alloc(unsigned long size)
27 if (size == 0)
28 return NULL;
30 return vmalloc_exec(size);
34 /* Free memory returned from module_alloc */
35 void module_free(struct module *mod, void *module_region)
37 vfree(module_region);
38 /* FIXME: If module_region == mod->init_region, trim exception
39 table entries. */
42 /* We don't need anything special. */
43 int module_frob_arch_sections(Elf_Ehdr *hdr,
44 Elf_Shdr *sechdrs,
45 char *secstrings,
46 struct module *mod)
48 return 0;
51 int apply_relocate(Elf32_Shdr *sechdrs,
52 const char *strtab,
53 unsigned int symindex,
54 unsigned int relsec,
55 struct module *me)
57 printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n", me->name);
58 return -ENOEXEC;
61 int apply_relocate_add(Elf32_Shdr *sechdrs,
62 const char *strtab,
63 unsigned int symindex,
64 unsigned int relsec,
65 struct module *me)
67 printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n", me->name);
68 return -ENOEXEC;
71 int module_finalize(const Elf_Ehdr *hdr,
72 const Elf_Shdr *sechdrs,
73 struct module *me)
75 return 0;
78 void module_arch_cleanup(struct module *mod)