Skip to content
Snippets Groups Projects
Commit fcda12e7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  modpost: Fix modpost's license checking V3
  module: add /sys/module/<name>/uevent files
  module: change attr callbacks to take struct module_kobject
  modules: make arch's use default loader hooks
  modules: add default loader hook implementations
  param: fix return value handling in param_set_*
parents 5fabc487 62a26356
No related merge requests found
Showing
with 12 additions and 568 deletions
...@@ -29,20 +29,6 @@ ...@@ -29,20 +29,6 @@
#define DEBUGP(fmt...) #define DEBUGP(fmt...)
#endif #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. */ /* Allocate the GOT at the end of the core sections. */
struct got_entry { struct got_entry {
...@@ -155,14 +141,6 @@ module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs, ...@@ -155,14 +141,6 @@ module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs,
return 0; 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 int
apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab, apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
unsigned int symindex, unsigned int relsec, unsigned int symindex, unsigned int relsec,
...@@ -302,15 +280,3 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab, ...@@ -302,15 +280,3 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
return 0; 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)
{
}
...@@ -43,25 +43,7 @@ void *module_alloc(unsigned long size) ...@@ -43,25 +43,7 @@ void *module_alloc(unsigned long size)
GFP_KERNEL, PAGE_KERNEL_EXEC, -1, GFP_KERNEL, PAGE_KERNEL_EXEC, -1,
__builtin_return_address(0)); __builtin_return_address(0));
} }
#else /* CONFIG_MMU */ #endif
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;
}
int int
apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, 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, ...@@ -265,15 +247,6 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
return 0; 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 { struct mod_unwind_map {
const Elf_Shdr *unw_sec; const Elf_Shdr *unw_sec;
const Elf_Shdr *txt_sec; const Elf_Shdr *txt_sec;
......
...@@ -19,13 +19,6 @@ ...@@ -19,13 +19,6 @@
#include <linux/moduleloader.h> #include <linux/moduleloader.h>
#include <linux/vmalloc.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) void module_free(struct module *mod, void *module_region)
{ {
vfree(mod->arch.syminfo); vfree(mod->arch.syminfo);
...@@ -299,15 +292,6 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, ...@@ -299,15 +292,6 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
return ret; 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, int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,
struct module *module) struct module *module)
{ {
...@@ -316,7 +300,3 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, ...@@ -316,7 +300,3 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,
return 0; return 0;
} }
void module_arch_cleanup(struct module *module)
{
}
...@@ -16,19 +16,6 @@ ...@@ -16,19 +16,6 @@
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/uaccess.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 */ /* Transfer the section to the L1 memory */
int int
module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
...@@ -150,14 +137,6 @@ 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; 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 */ /* FUNCTION : apply_relocate_add */
/* ABSTRACT : Blackfin specific relocation handling for the loadable */ /* ABSTRACT : Blackfin specific relocation handling for the loadable */
......
...@@ -30,45 +30,19 @@ ...@@ -30,45 +30,19 @@
#endif #endif
#ifdef CONFIG_ETRAX_KMALLOCED_MODULES #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) void *module_alloc(unsigned long size)
{ {
if (size == 0) if (size == 0)
return NULL; return NULL;
return MALLOC_MODULE(size); return kmalloc(size, GFP_KERNEL);
} }
/* Free memory returned from module_alloc */ /* Free memory returned from module_alloc */
void module_free(struct module *mod, void *module_region) void module_free(struct module *mod, void *module_region)
{ {
FREE_MODULE(module_region); kfree(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;
} }
#endif
int apply_relocate_add(Elf32_Shdr *sechdrs, int apply_relocate_add(Elf32_Shdr *sechdrs,
const char *strtab, const char *strtab,
...@@ -108,14 +82,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, ...@@ -108,14 +82,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
return 0; 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)
{
}
...@@ -22,57 +22,6 @@ ...@@ -22,57 +22,6 @@
#define DEBUGP(fmt...) #define DEBUGP(fmt...)
#endif #endif
void *module_alloc(unsigned long size) /* TODO: At least one of apply_relocate or apply_relocate_add must be
{ * implemented in order to get working module support.
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)
{
}
...@@ -11,40 +11,6 @@ ...@@ -11,40 +11,6 @@
#define DEBUGP(fmt...) #define DEBUGP(fmt...)
#endif #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, int apply_relocate_add(Elf32_Shdr *sechdrs,
const char *strtab, const char *strtab,
unsigned int symindex, unsigned int symindex,
...@@ -107,14 +73,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, ...@@ -107,14 +73,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
me->name, rela[i].r_offset); me->name, rela[i].r_offset);
return -ENOEXEC; 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)
{
}
...@@ -304,14 +304,6 @@ plt_target (struct plt_entry *plt) ...@@ -304,14 +304,6 @@ plt_target (struct plt_entry *plt)
#endif /* !USE_BRL */ #endif /* !USE_BRL */
void *
module_alloc (unsigned long size)
{
if (!size)
return NULL;
return vmalloc(size);
}
void void
module_free (struct module *mod, void *module_region) module_free (struct module *mod, void *module_region)
{ {
...@@ -853,14 +845,6 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind ...@@ -853,14 +845,6 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
return 0; 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 * 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 * sections but since the two are not contiguous, we need to split this table up such that
......
...@@ -28,33 +28,6 @@ ...@@ -28,33 +28,6 @@
#define DEBUGP(fmt...) #define DEBUGP(fmt...)
#endif #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) \ #define COPY_UNALIGNED_WORD(sw, tw, align) \
{ \ { \
void *__s = &(sw), *__t = &(tw); \ void *__s = &(sw), *__t = &(tw); \
...@@ -243,14 +216,3 @@ int apply_relocate(Elf32_Shdr *sechdrs, ...@@ -243,14 +216,3 @@ int apply_relocate(Elf32_Shdr *sechdrs,
return 0; 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)
{
}
...@@ -19,29 +19,6 @@ ...@@ -19,29 +19,6 @@
#ifdef CONFIG_MODULES #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, int apply_relocate(Elf32_Shdr *sechdrs,
const char *strtab, const char *strtab,
unsigned int symindex, unsigned int symindex,
...@@ -131,10 +108,6 @@ int module_finalize(const Elf_Ehdr *hdr, ...@@ -131,10 +108,6 @@ int module_finalize(const Elf_Ehdr *hdr,
return 0; return 0;
} }
void module_arch_cleanup(struct module *mod)
{
}
#endif /* CONFIG_MODULES */ #endif /* CONFIG_MODULES */
void module_fixup(struct module *mod, struct m68k_fixup_info *start, void module_fixup(struct module *mod, struct m68k_fixup_info *start,
......
...@@ -11,29 +11,6 @@ ...@@ -11,29 +11,6 @@
#define DEBUGP(fmt...) #define DEBUGP(fmt...)
#endif #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, int apply_relocate(Elf32_Shdr *sechdrs,
const char *strtab, const char *strtab,
unsigned int symindex, unsigned int symindex,
...@@ -113,14 +90,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, ...@@ -113,14 +90,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
} }
return 0; 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)
{
}
...@@ -18,37 +18,6 @@ ...@@ -18,37 +18,6 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/cacheflush.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, int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
unsigned int symindex, unsigned int relsec, struct module *module) unsigned int symindex, unsigned int relsec, struct module *module)
{ {
...@@ -155,7 +124,3 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, ...@@ -155,7 +124,3 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
flush_dcache(); flush_dcache();
return 0; return 0;
} }
void module_arch_cleanup(struct module *mod)
{
}
...@@ -45,30 +45,14 @@ static struct mips_hi16 *mips_hi16_list; ...@@ -45,30 +45,14 @@ static struct mips_hi16 *mips_hi16_list;
static LIST_HEAD(dbe_list); static LIST_HEAD(dbe_list);
static DEFINE_SPINLOCK(dbe_lock); static DEFINE_SPINLOCK(dbe_lock);
#ifdef MODULE_START
void *module_alloc(unsigned long size) void *module_alloc(unsigned long size)
{ {
#ifdef MODULE_START
return __vmalloc_node_range(size, 1, MODULE_START, MODULE_END, return __vmalloc_node_range(size, 1, MODULE_START, MODULE_END,
GFP_KERNEL, PAGE_KERNEL, -1, GFP_KERNEL, PAGE_KERNEL, -1,
__builtin_return_address(0)); __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) static int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v)
{ {
......
...@@ -32,36 +32,6 @@ ...@@ -32,36 +32,6 @@
#define DEBUGP(fmt, ...) #define DEBUGP(fmt, ...)
#endif #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) static void reloc_put16(uint8_t *p, uint32_t val)
{ {
p[0] = val & 0xff; p[0] = val & 0xff;
...@@ -80,20 +50,6 @@ static void reloc_put32(uint8_t *p, uint32_t val) ...@@ -80,20 +50,6 @@ static void reloc_put32(uint8_t *p, uint32_t val)
reloc_put16(p+2, val >> 16); 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 * apply a RELA relocation
*/ */
...@@ -198,20 +154,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, ...@@ -198,20 +154,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
} }
return 0; 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)
{
}
...@@ -540,18 +540,6 @@ static Elf_Addr get_stub(struct module *me, unsigned long value, long addend, ...@@ -540,18 +540,6 @@ static Elf_Addr get_stub(struct module *me, unsigned long value, long addend,
return (Elf_Addr)stub; 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 #ifndef CONFIG_64BIT
int apply_relocate_add(Elf_Shdr *sechdrs, int apply_relocate_add(Elf_Shdr *sechdrs,
const char *strtab, const char *strtab,
......
...@@ -31,20 +31,6 @@ ...@@ -31,20 +31,6 @@
LIST_HEAD(module_bug_list); 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, static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs, const Elf_Shdr *sechdrs,
const char *name) const char *name)
...@@ -93,7 +79,3 @@ int module_finalize(const Elf_Ehdr *hdr, ...@@ -93,7 +79,3 @@ int module_finalize(const Elf_Ehdr *hdr,
return 0; return 0;
} }
void module_arch_cleanup(struct module *mod)
{
}
...@@ -174,17 +174,6 @@ int module_frob_arch_sections(Elf32_Ehdr *hdr, ...@@ -174,17 +174,6 @@ int module_frob_arch_sections(Elf32_Ehdr *hdr,
return 0; 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) static inline int entry_matches(struct ppc_plt_entry *entry, Elf32_Addr val)
{ {
if (entry->jump[0] == 0x3d600000 + ((val + 0x8000) >> 16) if (entry->jump[0] == 0x3d600000 + ((val + 0x8000) >> 16)
......
...@@ -243,16 +243,6 @@ int module_frob_arch_sections(Elf64_Ehdr *hdr, ...@@ -243,16 +243,6 @@ int module_frob_arch_sections(Elf64_Ehdr *hdr,
return 0; 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 /* 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 gives the value maximum span in an instruction which uses a signed
offset) */ offset) */
......
...@@ -45,13 +45,6 @@ ...@@ -45,13 +45,6 @@
#define PLT_ENTRY_SIZE 20 #define PLT_ENTRY_SIZE 20
#endif /* CONFIG_64BIT */ #endif /* CONFIG_64BIT */
void *module_alloc(unsigned long size)
{
if (size == 0)
return NULL;
return vmalloc(size);
}
/* Free memory returned from module_alloc */ /* Free memory returned from module_alloc */
void module_free(struct module *mod, void *module_region) void module_free(struct module *mod, void *module_region)
{ {
...@@ -176,15 +169,6 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, ...@@ -176,15 +169,6 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
return 0; 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 static int
apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab, apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
struct module *me) struct module *me)
...@@ -409,7 +393,3 @@ int module_finalize(const Elf_Ehdr *hdr, ...@@ -409,7 +393,3 @@ int module_finalize(const Elf_Ehdr *hdr,
me->arch.syminfo = NULL; me->arch.syminfo = NULL;
return 0; return 0;
} }
void module_arch_cleanup(struct module *mod)
{
}
...@@ -27,23 +27,6 @@ ...@@ -27,23 +27,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/vmalloc.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, int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
unsigned int symindex, unsigned int relindex, unsigned int symindex, unsigned int relindex,
struct module *me) struct module *me)
...@@ -146,6 +129,9 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, ...@@ -146,6 +129,9 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
unsigned int symindex, unsigned int relsec, unsigned int symindex, unsigned int relsec,
struct module *me) struct module *me)
{ {
/* Non-standard return value... most other arch's return -ENOEXEC
* for an unsupported relocation variant
*/
return 0; return 0;
} }
...@@ -154,12 +140,3 @@ const struct exception_table_entry *search_module_dbetables(unsigned long addr) ...@@ -154,12 +140,3 @@ const struct exception_table_entry *search_module_dbetables(unsigned long addr)
{ {
return NULL; 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) {}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment