Commit 18f50759 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] "constfrobbing considered harmful"

The declaration of `module_frob_arch_sections' in moduleloader.h (and
the definitions in most of the module.c files) are inconsistent with the
definition in the PPC's module.c -- in the latter the first two
arguments are not declared `const', whereas everyplace else they are.

PS.  secstrings can be modded to: if an arch can't handle discarding
     init, it simply renames the .init sections.
parent 1086892d
......@@ -67,9 +67,9 @@ void module_free(struct module *module, void *region)
vfree(region);
}
int module_frob_arch_sections(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
const char *secstrings,
int module_frob_arch_sections(Elf_Ehdr *hdr,
Elf_Shdr *sechdrs,
char *secstrings,
struct module *mod)
{
return 0;
......
......@@ -45,9 +45,9 @@ void module_free(struct module *mod, void *module_region)
}
/* We don't need anything special. */
int module_frob_arch_sections(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
const char *secstrings,
int module_frob_arch_sections(Elf_Ehdr *hdr,
Elf_Shdr *sechdrs,
char *secstrings,
struct module *mod)
{
return 0;
......
......@@ -103,7 +103,7 @@ static unsigned long get_plt_size(const Elf32_Ehdr *hdr,
int module_frob_arch_sections(Elf32_Ehdr *hdr,
Elf32_Shdr *sechdrs,
const char *secstrings,
char *secstrings,
struct module *me)
{
unsigned int i;
......
......@@ -51,9 +51,9 @@ void module_free(struct module *mod, void *module_region)
table entries. */
}
int module_frob_arch_sections(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
const char *secstrings,
int module_frob_arch_sections(Elf_Ehdr *hdr,
Elf_Shdr *sechdrs,
char *secstrings,
struct module *mod)
{
// FIXME: add space needed for GOT/PLT
......
......@@ -52,9 +52,9 @@ void module_free(struct module *mod, void *module_region)
}
/* s390/s390x needs additional memory for GOT/PLT sections. */
int module_frob_arch_sections(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
const char *secstrings,
int module_frob_arch_sections(Elf_Ehdr *hdr,
Elf_Shdr *sechdrs,
char *secstrings,
struct module *mod)
{
// FIXME: add space needed for GOT/PLT
......
......@@ -37,9 +37,9 @@ void module_free(struct module *mod, void *module_region)
}
/* We don't need anything special. */
int module_frob_arch_sections(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
const char *secstrings,
int module_frob_arch_sections(Elf_Ehdr *hdr,
Elf_Shdr *sechdrs,
char *secstrings,
struct module *mod)
{
return 0;
......
......@@ -144,9 +144,9 @@ void module_free(struct module *mod, void *module_region)
}
/* We don't need anything special. */
int module_frob_arch_sections(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
const char *secstrings,
int module_frob_arch_sections(Elf_Ehdr *hdr,
Elf_Shdr *sechdrs,
char *secstrings,
struct module *mod)
{
return 0;
......
......@@ -26,9 +26,9 @@
#define DEBUGP(fmt...)
/* We don't need anything special. */
int module_frob_arch_sections(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
const char *secstrings,
int module_frob_arch_sections(Elf_Ehdr *hdr,
Elf_Shdr *sechdrs,
char *secstrings,
struct module *mod)
{
return 0;
......
......@@ -16,9 +16,9 @@ unsigned long find_symbol_internal(Elf_Shdr *sechdrs,
/* These must be implemented by the specific architecture */
/* Adjust arch-specific sections. Return 0 on success. */
int module_frob_arch_sections(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
const char *secstrings,
int module_frob_arch_sections(Elf_Ehdr *hdr,
Elf_Shdr *sechdrs,
char *secstrings,
struct module *mod);
/* Allocator used for allocating struct module, core sections and init
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment