]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
modules: make arch's use default loader hooks
authorJonas Bonn <jonas@southpole.se>
Thu, 30 Jun 2011 19:22:12 +0000 (21:22 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Sun, 24 Jul 2011 12:36:04 +0000 (22:06 +0930)
This patch removes all the module loader hook implementations in the
architecture specific code where the functionality is the same as that
now provided by the recently added default hooks.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
26 files changed:
arch/alpha/kernel/module.c
arch/arm/kernel/module.c
arch/avr32/kernel/module.c
arch/blackfin/kernel/module.c
arch/cris/kernel/module.c
arch/frv/kernel/module.c
arch/h8300/kernel/module.c
arch/ia64/kernel/module.c
arch/m32r/kernel/module.c
arch/m68k/kernel/module_mm.c
arch/m68k/kernel/module_no.c
arch/microblaze/kernel/module.c
arch/mips/kernel/module.c
arch/mn10300/kernel/module.c
arch/parisc/kernel/module.c
arch/powerpc/kernel/module.c
arch/powerpc/kernel/module_32.c
arch/powerpc/kernel/module_64.c
arch/s390/kernel/module.c
arch/score/kernel/module.c
arch/sh/kernel/module.c
arch/sparc/kernel/module.c
arch/tile/kernel/module.c
arch/unicore32/kernel/module.c
arch/x86/kernel/module.c
arch/xtensa/kernel/module.c

index ebc3c894b5a2cc0d5a871e0e30ac99249d599bd7..2fd00b7077e41f17c654fac08c732f2ed62e1b1b 100644 (file)
 #define DEBUGP(fmt...)
 #endif
 
-void *
-module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-       return vmalloc(size);
-}
-
-void
-module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
 /* Allocate the GOT at the end of the core sections.  */
 
 struct got_entry {
@@ -155,14 +141,6 @@ module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs,
        return 0;
 }
 
-int
-apply_relocate(Elf64_Shdr *sechdrs, const char *strtab, unsigned int symindex,
-              unsigned int relsec, struct module *me)
-{
-       printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
-       return -ENOEXEC;
-}
-
 int
 apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
                   unsigned int symindex, unsigned int relsec,
@@ -302,15 +280,3 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
 
        return 0;
 }
-
-int
-module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,
-               struct module *me)
-{
-       return 0;
-}
-
-void
-module_arch_cleanup(struct module *mod)
-{
-}
index 016d6a0830a3e202bc42df7c40108a0875916d4b..05b377616fd54825c3d7c1316548a11c9c6f60d4 100644 (file)
@@ -43,25 +43,7 @@ void *module_alloc(unsigned long size)
                                GFP_KERNEL, PAGE_KERNEL_EXEC, -1,
                                __builtin_return_address(0));
 }
-#else /* CONFIG_MMU */
-void *module_alloc(unsigned long size)
-{
-       return size == 0 ? NULL : vmalloc(size);
-}
-#endif /* !CONFIG_MMU */
-
-void module_free(struct module *module, void *region)
-{
-       vfree(region);
-}
-
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
+#endif
 
 int
 apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
@@ -265,15 +247,6 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
        return 0;
 }
 
-int
-apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
-                  unsigned int symindex, unsigned int relsec, struct module *module)
-{
-       printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
-              module->name);
-       return -ENOEXEC;
-}
-
 struct mod_unwind_map {
        const Elf_Shdr *unw_sec;
        const Elf_Shdr *txt_sec;
index a727f54d64d6e633d58ae2836bbbfae4c82f0017..596f7305d93f017c43af7fc5f965ea4d0b988246 100644 (file)
 #include <linux/moduleloader.h>
 #include <linux/vmalloc.h>
 
-void *module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-       return vmalloc(size);
-}
-
 void module_free(struct module *mod, void *module_region)
 {
        vfree(mod->arch.syminfo);
@@ -299,15 +292,6 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
        return ret;
 }
 
-int apply_relocate(Elf32_Shdr *sechdrs, const char *strtab,
-                  unsigned int symindex, unsigned int relindex,
-                  struct module *module)
-{
-       printk(KERN_ERR "module %s: REL relocations are not supported\n",
-               module->name);
-       return -ENOEXEC;
-}
-
 int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,
                    struct module *module)
 {
@@ -316,7 +300,3 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,
 
        return 0;
 }
-
-void module_arch_cleanup(struct module *module)
-{
-}
index 35e350cad9d943a0c733c2488dfef18f19a30f9e..4489efc528837f9bf6fd3e7bbb4ae94743906b09 100644 (file)
 #include <asm/cacheflush.h>
 #include <asm/uaccess.h>
 
-void *module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-       return vmalloc(size);
-}
-
-/* Free memory returned from module_alloc */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
 /* Transfer the section to the L1 memory */
 int
 module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
@@ -150,14 +137,6 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
        return 0;
 }
 
-int
-apply_relocate(Elf_Shdr * sechdrs, const char *strtab,
-              unsigned int symindex, unsigned int relsec, struct module *mod)
-{
-       pr_err(".rel unsupported\n");
-       return -ENOEXEC;
-}
-
 /*************************************************************************/
 /* FUNCTION : apply_relocate_add                                         */
 /* ABSTRACT : Blackfin specific relocation handling for the loadable     */
index bcd502f74cda46e6ef8c710fe4d76daea0e124f2..37400f5869e6137d780be5326ab49875d939f15c 100644 (file)
 #endif
 
 #ifdef CONFIG_ETRAX_KMALLOCED_MODULES
-#define MALLOC_MODULE(size) kmalloc(size, GFP_KERNEL)
-#define FREE_MODULE(region) kfree(region)
-#else
-#define MALLOC_MODULE(size) vmalloc_exec(size)
-#define FREE_MODULE(region) vfree(region)
-#endif
-
 void *module_alloc(unsigned long size)
 {
        if (size == 0)
                return NULL;
-       return MALLOC_MODULE(size);
+       return kmalloc(size, GFP_KERNEL);
 }
 
-
 /* Free memory returned from module_alloc */
 void module_free(struct module *mod, void *module_region)
 {
-       FREE_MODULE(module_region);
-}
-
-/* We don't need anything special. */
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
-
-int apply_relocate(Elf32_Shdr *sechdrs,
-                  const char *strtab,
-                  unsigned int symindex,
-                  unsigned int relsec,
-                  struct module *me)
-{
-       printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
-       return -ENOEXEC;
+       kfree(module_region);
 }
+#endif
 
 int apply_relocate_add(Elf32_Shdr *sechdrs,
                       const char *strtab,
@@ -108,14 +82,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
 
        return 0;
 }
-
-int module_finalize(const Elf_Ehdr *hdr,
-                   const Elf_Shdr *sechdrs,
-                   struct module *me)
-{
-       return 0;
-}
-
-void module_arch_cleanup(struct module *mod)
-{
-}
index 711763c8a6f3a76c5901d43f0744e09aa94d6e6c..9d9835f1fe2b2ac2c63a32ca46349707b88a6fd2 100644 (file)
 #define DEBUGP(fmt...)
 #endif
 
-void *module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-
-       return vmalloc_exec(size);
-}
-
-
-/* Free memory returned from module_alloc */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
-/* We don't need anything special. */
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
-
-int apply_relocate(Elf32_Shdr *sechdrs,
-                  const char *strtab,
-                  unsigned int symindex,
-                  unsigned int relsec,
-                  struct module *me)
-{
-       printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n", me->name);
-       return -ENOEXEC;
-}
-
-int apply_relocate_add(Elf32_Shdr *sechdrs,
-                      const char *strtab,
-                      unsigned int symindex,
-                      unsigned int relsec,
-                      struct module *me)
-{
-       printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n", me->name);
-       return -ENOEXEC;
-}
-
-int module_finalize(const Elf_Ehdr *hdr,
-                   const Elf_Shdr *sechdrs,
-                   struct module *me)
-{
-       return 0;
-}
-
-void module_arch_cleanup(struct module *mod)
-{
-}
+/* TODO: At least one of apply_relocate or apply_relocate_add must be
+ * implemented in order to get working module support.
+ */
index db4953dc4e1b445adbdd7e004a68890a5c1c07a6..1d526e05db19b5613a33f47997803154dc200037 100644 (file)
 #define DEBUGP(fmt...)
 #endif
 
-void *module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-       return vmalloc(size);
-}
-
-
-/* Free memory returned from module_alloc */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
-/* We don't need anything special. */
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
-
-int apply_relocate(Elf32_Shdr *sechdrs,
-                  const char *strtab,
-                  unsigned int symindex,
-                  unsigned int relsec,
-                  struct module *me)
-{
-       printk(KERN_ERR "module %s: RELOCATION unsupported\n",
-              me->name);
-       return -ENOEXEC;
-}
-
 int apply_relocate_add(Elf32_Shdr *sechdrs,
                       const char *strtab,
                       unsigned int symindex,
@@ -107,14 +73,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
               me->name, rela[i].r_offset);
        return -ENOEXEC;
 }
-
-int module_finalize(const Elf_Ehdr *hdr,
-                   const Elf_Shdr *sechdrs,
-                   struct module *me)
-{
-       return 0;
-}
-
-void module_arch_cleanup(struct module *mod)
-{
-}
index 1481b0a28ca03d46c71de2ca775393554d81bbb0..24603be24c14acbbcb29874b45fb55518fed3cc7 100644 (file)
@@ -304,14 +304,6 @@ plt_target (struct plt_entry *plt)
 
 #endif /* !USE_BRL */
 
-void *
-module_alloc (unsigned long size)
-{
-       if (!size)
-               return NULL;
-       return vmalloc(size);
-}
-
 void
 module_free (struct module *mod, void *module_region)
 {
@@ -853,14 +845,6 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
        return 0;
 }
 
-int
-apply_relocate (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symindex,
-               unsigned int relsec, struct module *mod)
-{
-       printk(KERN_ERR "module %s: REL relocs in section %u unsupported\n", mod->name, relsec);
-       return -ENOEXEC;
-}
-
 /*
  * Modules contain a single unwind table which covers both the core and the init text
  * sections but since the two are not contiguous, we need to split this table up such that
index cb5f37d78d490889c0fc80e747d54d35c97c263a..3071fe83ffc8aac10c1083bca7a7d940e9383400 100644 (file)
 #define DEBUGP(fmt...)
 #endif
 
-void *module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-#ifdef CONFIG_MMU
-       return vmalloc_exec(size);
-#else
-       return vmalloc(size);
-#endif
-}
-
-
-/* Free memory returned from module_alloc */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
-/* We don't need anything special. */
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
-
 #define COPY_UNALIGNED_WORD(sw, tw, align) \
 { \
        void *__s = &(sw), *__t = &(tw); \
@@ -243,14 +216,3 @@ int apply_relocate(Elf32_Shdr *sechdrs,
        return 0;
 
 }
-
-int module_finalize(const Elf_Ehdr *hdr,
-                   const Elf_Shdr *sechdrs,
-                   struct module *me)
-{
-       return 0;
-}
-
-void module_arch_cleanup(struct module *mod)
-{
-}
index cd6bcb1c957e925c55583a0249961f09e395b74d..ceafc47c96d514bd6958841de2c406654d47043f 100644 (file)
 
 #ifdef CONFIG_MODULES
 
-void *module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-       return vmalloc(size);
-}
-
-
-/* Free memory returned from module_alloc */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
-/* We don't need anything special. */
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
-
 int apply_relocate(Elf32_Shdr *sechdrs,
                   const char *strtab,
                   unsigned int symindex,
@@ -131,10 +108,6 @@ int module_finalize(const Elf_Ehdr *hdr,
        return 0;
 }
 
-void module_arch_cleanup(struct module *mod)
-{
-}
-
 #endif /* CONFIG_MODULES */
 
 void module_fixup(struct module *mod, struct m68k_fixup_info *start,
index d11ffae7956a5d31fbbc02251aff1fff073f3b0a..5a097c6063fa664b36d25ecae160f82540faabd4 100644 (file)
 #define DEBUGP(fmt...)
 #endif
 
-void *module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-       return vmalloc(size);
-}
-
-
-/* Free memory returned from module_alloc */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
-/* We don't need anything special. */
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
-
 int apply_relocate(Elf32_Shdr *sechdrs,
                   const char *strtab,
                   unsigned int symindex,
@@ -113,14 +90,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
        }
        return 0;
 }
-
-int module_finalize(const Elf_Ehdr *hdr,
-                   const Elf_Shdr *sechdrs,
-                   struct module *me)
-{
-       return 0;
-}
-
-void module_arch_cleanup(struct module *mod)
-{
-}
index 0e73f6606547ce03f1be8c048971b9de6275c3a0..142426f631bb7e34ded5faa048144fafcafb8e12 100644 (file)
 #include <asm/pgtable.h>
 #include <asm/cacheflush.h>
 
-void *module_alloc(unsigned long size)
-{
-       void *ret;
-       ret = (size == 0) ? NULL : vmalloc(size);
-       pr_debug("module_alloc (%08lx@%08lx)\n", size, (unsigned long int)ret);
-       return ret;
-}
-
-void module_free(struct module *module, void *region)
-{
-       pr_debug("module_free(%s,%08lx)\n", module->name,
-                                       (unsigned long)region);
-       vfree(region);
-}
-
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                               Elf_Shdr *sechdrs,
-                               char *secstrings,
-                               struct module *mod)
-{
-       return 0;
-}
-
-int apply_relocate(Elf32_Shdr *sechdrs, const char *strtab,
-       unsigned int symindex, unsigned int relsec, struct module *module)
-{
-       printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
-               module->name);
-       return -ENOEXEC;
-}
-
 int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
        unsigned int symindex, unsigned int relsec, struct module *module)
 {
@@ -155,7 +124,3 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
        flush_dcache();
        return 0;
 }
-
-void module_arch_cleanup(struct module *mod)
-{
-}
index dd940b70196387c5b9f39a026100e0054444a175..4b930ac4aff250b84aeed1d4ee895da5af79469a 100644 (file)
@@ -45,30 +45,14 @@ static struct mips_hi16 *mips_hi16_list;
 static LIST_HEAD(dbe_list);
 static DEFINE_SPINLOCK(dbe_lock);
 
+#ifdef MODULE_START
 void *module_alloc(unsigned long size)
 {
-#ifdef MODULE_START
        return __vmalloc_node_range(size, 1, MODULE_START, MODULE_END,
                                GFP_KERNEL, PAGE_KERNEL, -1,
                                __builtin_return_address(0));
-#else
-       if (size == 0)
-               return NULL;
-       return vmalloc(size);
-#endif
-}
-
-/* Free memory returned from module_alloc */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
-int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
-                             char *secstrings, struct module *mod)
-{
-       return 0;
 }
+#endif
 
 static int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v)
 {
index 196a111e2e2937b134217356991c0ca2f68bda05..216ad23c9570f3083b498aefa3dd166ec8e04eea 100644 (file)
 #define DEBUGP(fmt, ...)
 #endif
 
-/*
- * allocate storage for a module
- */
-void *module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-       return vmalloc_exec(size);
-}
-
-/*
- * free memory returned from module_alloc()
- */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
-/*
- * allow the arch to fix up the section table
- * - we don't need anything special
- */
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
-
 static void reloc_put16(uint8_t *p, uint32_t val)
 {
        p[0] = val & 0xff;
@@ -80,20 +50,6 @@ static void reloc_put32(uint8_t *p, uint32_t val)
        reloc_put16(p+2, val >> 16);
 }
 
-/*
- * apply a REL relocation
- */
-int apply_relocate(Elf32_Shdr *sechdrs,
-                  const char *strtab,
-                  unsigned int symindex,
-                  unsigned int relsec,
-                  struct module *me)
-{
-       printk(KERN_ERR "module %s: RELOCATION unsupported\n",
-              me->name);
-       return -ENOEXEC;
-}
-
 /*
  * apply a RELA relocation
  */
@@ -198,20 +154,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
        }
        return 0;
 }
-
-/*
- * finish loading the module
- */
-int module_finalize(const Elf_Ehdr *hdr,
-                   const Elf_Shdr *sechdrs,
-                   struct module *me)
-{
-       return 0;
-}
-
-/*
- * finish clearing the module
- */
-void module_arch_cleanup(struct module *mod)
-{
-}
index cedbbb8b18d9508ef1539068355911cfda0be66a..5e34ccf39a49eba54d9a0cbf74c2055ed439cb43 100644 (file)
@@ -540,18 +540,6 @@ static Elf_Addr get_stub(struct module *me, unsigned long value, long addend,
        return (Elf_Addr)stub;
 }
 
-int apply_relocate(Elf_Shdr *sechdrs,
-                  const char *strtab,
-                  unsigned int symindex,
-                  unsigned int relsec,
-                  struct module *me)
-{
-       /* parisc should not need this ... */
-       printk(KERN_ERR "module %s: RELOCATION unsupported\n",
-              me->name);
-       return -ENOEXEC;
-}
-
 #ifndef CONFIG_64BIT
 int apply_relocate_add(Elf_Shdr *sechdrs,
                       const char *strtab,
index 49cee9df225be8bfc6b06a429ee9243d10484439..a1cd701b5753d19f2e83b4330560c1020bcfccf2 100644 (file)
 
 LIST_HEAD(module_bug_list);
 
-void *module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-
-       return vmalloc_exec(size);
-}
-
-/* Free memory returned from module_alloc */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
 static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
                                    const Elf_Shdr *sechdrs,
                                    const char *name)
@@ -93,7 +79,3 @@ int module_finalize(const Elf_Ehdr *hdr,
 
        return 0;
 }
-
-void module_arch_cleanup(struct module *mod)
-{
-}
index f832773fc28e940f82ed0dcecc6104d5e6e71939..0b6d79617d7b08adb56c05286a167931cca6a3a9 100644 (file)
@@ -174,17 +174,6 @@ int module_frob_arch_sections(Elf32_Ehdr *hdr,
        return 0;
 }
 
-int apply_relocate(Elf32_Shdr *sechdrs,
-                  const char *strtab,
-                  unsigned int symindex,
-                  unsigned int relsec,
-                  struct module *module)
-{
-       printk(KERN_ERR "%s: Non-ADD RELOCATION unsupported\n",
-              module->name);
-       return -ENOEXEC;
-}
-
 static inline int entry_matches(struct ppc_plt_entry *entry, Elf32_Addr val)
 {
        if (entry->jump[0] == 0x3d600000 + ((val + 0x8000) >> 16)
index 8fbb12508bf3a25b54401ef1907d3930bc30522e..9f44a775a106dbfd29ceba2ea93d9bf5df66e5ce 100644 (file)
@@ -243,16 +243,6 @@ int module_frob_arch_sections(Elf64_Ehdr *hdr,
        return 0;
 }
 
-int apply_relocate(Elf64_Shdr *sechdrs,
-                  const char *strtab,
-                  unsigned int symindex,
-                  unsigned int relsec,
-                  struct module *me)
-{
-       printk(KERN_ERR "%s: Non-ADD RELOCATION unsupported\n", me->name);
-       return -ENOEXEC;
-}
-
 /* r2 is the TOC pointer: it actually points 0x8000 into the TOC (this
    gives the value maximum span in an instruction which uses a signed
    offset) */
index f7167ee4604cf7033e30eb3845aa8f9ba9fd538b..dfcb3436bad069d9dd75290d54c868b92a2d6beb 100644 (file)
 #define PLT_ENTRY_SIZE 20
 #endif /* CONFIG_64BIT */
 
-void *module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-       return vmalloc(size);
-}
-
 /* Free memory returned from module_alloc */
 void module_free(struct module *mod, void *module_region)
 {
@@ -176,15 +169,6 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
        return 0;
 }
 
-int
-apply_relocate(Elf_Shdr *sechdrs, const char *strtab, unsigned int symindex,
-              unsigned int relsec, struct module *me)
-{
-       printk(KERN_ERR "module %s: RELOCATION unsupported\n",
-              me->name);
-       return -ENOEXEC;
-}
-
 static int
 apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, 
           struct module *me)
@@ -409,7 +393,3 @@ int module_finalize(const Elf_Ehdr *hdr,
        me->arch.syminfo = NULL;
        return 0;
 }
-
-void module_arch_cleanup(struct module *mod)
-{
-}
index 4de8d47becd3a62c083d8cff5bdeac3e1c45192c..469e3b64e2f26aa760a307d68827eacc0768df21 100644 (file)
 #include <linux/module.h>
 #include <linux/vmalloc.h>
 
-void *module_alloc(unsigned long size)
-{
-       return size ? vmalloc(size) : NULL;
-}
-
-/* Free memory returned from module_alloc */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
-int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
-                       char *secstrings, struct module *mod)
-{
-       return 0;
-}
-
 int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
                unsigned int symindex, unsigned int relindex,
                struct module *me)
@@ -146,6 +129,9 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
                unsigned int symindex, unsigned int relsec,
                struct module *me)
 {
+       /* Non-standard return value... most other arch's return -ENOEXEC
+        * for an unsupported relocation variant
+        */
        return 0;
 }
 
@@ -154,12 +140,3 @@ const struct exception_table_entry *search_module_dbetables(unsigned long addr)
 {
        return NULL;
 }
-
-/* Put in dbe list if necessary. */
-int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,
-               struct module *me)
-{
-       return 0;
-}
-
-void module_arch_cleanup(struct module *mod) {}
index 19b1f8826aef9ba9b2508d71db05f6d8b178b772..1b525dedd29a50afe6e4f149bc3ef89a71d7b57c 100644 (file)
 #include <asm/unaligned.h>
 #include <asm/dwarf.h>
 
-void *module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-
-       return vmalloc_exec(size);
-}
-
-
-/* Free memory returned from module_alloc */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
-/* We don't need anything special. */
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
-
 int apply_relocate_add(Elf32_Shdr *sechdrs,
                   const char *strtab,
                   unsigned int symindex,
@@ -133,17 +109,6 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
        return 0;
 }
 
-int apply_relocate(Elf32_Shdr *sechdrs,
-                      const char *strtab,
-                      unsigned int symindex,
-                      unsigned int relsec,
-                      struct module *me)
-{
-       printk(KERN_ERR "module %s: REL RELOCATION unsupported\n",
-              me->name);
-       return -ENOEXEC;
-}
-
 int module_finalize(const Elf_Ehdr *hdr,
                    const Elf_Shdr *sechdrs,
                    struct module *me)
index 99ba5baa9497da77a773a2fc9da7600b2ee16816..da0c6c70ccb2c0a783043c151bd82d3dc289d86a 100644 (file)
@@ -68,12 +68,6 @@ void *module_alloc(unsigned long size)
        return ret;
 }
 
-/* Free memory returned from module_core_alloc/module_init_alloc */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
 /* Make generic code ignore STT_REGISTER dummy undefined symbols.  */
 int module_frob_arch_sections(Elf_Ehdr *hdr,
                              Elf_Shdr *sechdrs,
@@ -107,17 +101,6 @@ int module_frob_arch_sections(Elf_Ehdr *hdr,
        return 0;
 }
 
-int apply_relocate(Elf_Shdr *sechdrs,
-                  const char *strtab,
-                  unsigned int symindex,
-                  unsigned int relsec,
-                  struct module *me)
-{
-       printk(KERN_ERR "module %s: non-ADD RELOCATION unsupported\n",
-              me->name);
-       return -ENOEXEC;
-}
-
 int apply_relocate_add(Elf_Shdr *sechdrs,
                       const char *strtab,
                       unsigned int symindex,
@@ -239,15 +222,4 @@ int module_finalize(const Elf_Ehdr *hdr,
 
        return 0;
 }
-#else
-int module_finalize(const Elf_Ehdr *hdr,
-                    const Elf_Shdr *sechdrs,
-                    struct module *me)
-{
-        return 0;
-}
 #endif /* CONFIG_SPARC64 */
-
-void module_arch_cleanup(struct module *mod)
-{
-}
index f68df69f1f67bcc20ab6e90708014240887a7c50..28fa6ece9d3aaac8940374a3a313c8fa0a352a67 100644 (file)
@@ -98,25 +98,6 @@ void module_free(struct module *mod, void *module_region)
         */
 }
 
-/* We don't need anything special. */
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
-
-int apply_relocate(Elf_Shdr *sechdrs,
-                  const char *strtab,
-                  unsigned int symindex,
-                  unsigned int relsec,
-                  struct module *me)
-{
-       pr_err("module %s: .rel relocation unsupported\n", me->name);
-       return -ENOEXEC;
-}
-
 #ifdef __tilegx__
 /*
  * Validate that the high 16 bits of "value" is just the sign-extension of
@@ -249,15 +230,3 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
        }
        return 0;
 }
-
-int module_finalize(const Elf_Ehdr *hdr,
-                   const Elf_Shdr *sechdrs,
-                   struct module *me)
-{
-       /* FIXME: perhaps remove the "writable" bit from the TLB? */
-       return 0;
-}
-
-void module_arch_cleanup(struct module *mod)
-{
-}
index 3e5a38d71a1e45d8e8d5aa3333790f69b03aac83..8fbe8577f5e6902d07667ad426bdc6f2f5b8bfe9 100644 (file)
@@ -37,19 +37,6 @@ void *module_alloc(unsigned long size)
        return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL_EXEC);
 }
 
-void module_free(struct module *module, void *region)
-{
-       vfree(region);
-}
-
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
-
 int
 apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
               unsigned int relindex, struct module *module)
@@ -128,25 +115,3 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
        }
        return 0;
 }
-
-int
-apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
-                  unsigned int symindex, unsigned int relsec,
-                  struct module *module)
-{
-       printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
-              module->name);
-       return -ENOEXEC;
-}
-
-int
-module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
-               struct module *module)
-{
-       return 0;
-}
-
-void
-module_arch_cleanup(struct module *mod)
-{
-}
index 52f256f2cc81323f20579c02253befc2b1cf4845..925179f871decdc55cefe1bb3b3a9b6d99c67335 100644 (file)
@@ -45,21 +45,6 @@ void *module_alloc(unsigned long size)
                                -1, __builtin_return_address(0));
 }
 
-/* Free memory returned from module_alloc */
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
-/* We don't need anything special. */
-int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
-
 #ifdef CONFIG_X86_32
 int apply_relocate(Elf32_Shdr *sechdrs,
                   const char *strtab,
@@ -100,17 +85,6 @@ int apply_relocate(Elf32_Shdr *sechdrs,
        }
        return 0;
 }
-
-int apply_relocate_add(Elf32_Shdr *sechdrs,
-                      const char *strtab,
-                      unsigned int symindex,
-                      unsigned int relsec,
-                      struct module *me)
-{
-       printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
-              me->name);
-       return -ENOEXEC;
-}
 #else /*X86_64*/
 int apply_relocate_add(Elf64_Shdr *sechdrs,
                   const char *strtab,
@@ -181,17 +155,6 @@ overflow:
               me->name);
        return -ENOEXEC;
 }
-
-int apply_relocate(Elf_Shdr *sechdrs,
-                  const char *strtab,
-                  unsigned int symindex,
-                  unsigned int relsec,
-                  struct module *me)
-{
-       printk(KERN_ERR "non add relocation not supported\n");
-       return -ENOSYS;
-}
-
 #endif
 
 int module_finalize(const Elf_Ehdr *hdr,
index c1accea8cb56c036cec14091d5b85f98b2c572e7..451dda928c934539b2733545686fff1ee2058288 100644 (file)
 
 #undef DEBUG_RELOCATE
 
-void *module_alloc(unsigned long size)
-{
-       if (size == 0)
-               return NULL;
-       return vmalloc_exec(size);
-}
-
-void module_free(struct module *mod, void *module_region)
-{
-       vfree(module_region);
-}
-
-int module_frob_arch_sections(Elf32_Ehdr *hdr,
-                             Elf32_Shdr *sechdrs,
-                             char *secstrings,
-                             struct module *mod)
-{
-       return 0;
-}
-
 static int
 decode_calln_opcode (unsigned char *location)
 {
@@ -66,18 +46,6 @@ decode_l32r_opcode (unsigned char *location)
 #endif
 }
 
-int apply_relocate(Elf32_Shdr *sechdrs,
-                  const char *strtab,
-                  unsigned int symindex,
-                  unsigned int relsec,
-                  struct module *mod)
-{
-        printk(KERN_ERR "module %s: REL RELOCATION unsupported\n",
-               mod->name);
-        return -ENOEXEC;
-
-}
-
 int apply_relocate_add(Elf32_Shdr *sechdrs,
                       const char *strtab,
                       unsigned int symindex,
@@ -222,14 +190,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
        }
        return 0;
 }
-
-int module_finalize(const Elf_Ehdr *hdr,
-                   const Elf_Shdr *sechdrs,
-                   struct module *mod)
-{
-       return 0;
-}
-
-void module_arch_cleanup(struct module *mod)
-{
-}