Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66574cc0 authored by Jonas Bonn's avatar Jonas Bonn Committed by Rusty Russell
Browse files

modules: make arch's use default loader hooks



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: default avatarJonas Bonn <jonas@southpole.se>
Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Tested-by: default avatarMichal Simek <monstr@monstr.eu>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 74e08fcf
Loading
Loading
Loading
Loading
+0 −34
Original line number Diff line number Diff line
@@ -29,20 +29,6 @@
#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)
{
}
+1 −28
Original line number Diff line number Diff line
@@ -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;
+0 −20
Original line number Diff line number Diff line
@@ -19,13 +19,6 @@
#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)
{
}
+0 −21
Original line number Diff line number Diff line
@@ -16,19 +16,6 @@
#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     */
+3 −40
Original line number Diff line number Diff line
@@ -30,45 +30,19 @@
#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)
{
}
Loading