1
2
3
4
5
6
7
8
9
10
11
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>
18
19#if 0
20#define DEBUGP printk
21#else
22#define DEBUGP(fmt...)
23#endif
24
25void *module_alloc(unsigned long size)
26{
27 if (size == 0)
28 return NULL;
29
30 return vmalloc_exec(size);
31}
32
33
34
35void module_free(struct module *mod, void *module_region)
36{
37 vfree(module_region);
38}
39
40
41int module_frob_arch_sections(Elf_Ehdr *hdr,
42 Elf_Shdr *sechdrs,
43 char *secstrings,
44 struct module *mod)
45{
46 return 0;
47}
48
49int apply_relocate(Elf32_Shdr *sechdrs,
50 const char *strtab,
51 unsigned int symindex,
52 unsigned int relsec,
53 struct module *me)
54{
55 printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n", me->name);
56 return -ENOEXEC;
57}
58
59int apply_relocate_add(Elf32_Shdr *sechdrs,
60 const char *strtab,
61 unsigned int symindex,
62 unsigned int relsec,
63 struct module *me)
64{
65 printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n", me->name);
66 return -ENOEXEC;
67}
68
69int module_finalize(const Elf_Ehdr *hdr,
70 const Elf_Shdr *sechdrs,
71 struct module *me)
72{
73 return 0;
74}
75
76void module_arch_cleanup(struct module *mod)
77{
78}
79