X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=kernel%2Fmodule.c;h=b5dd92e35b02a78b44532cbdcf69292350dca456;hb=b5304a4f9ad88a712c26c63691a99c0b9b1b5dc6;hp=20fb004e7d8da0f851c540919fcc52fc1364e881;hpb=d72cd4ad4174cfd2257c426ad51e4f53bcfde9c9;p=linux-2.6-microblaze.git diff --git a/kernel/module.c b/kernel/module.c index 20fb004e7d8d..b5dd92e35b02 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2807,7 +2807,11 @@ void * __weak module_alloc(unsigned long size) bool __weak module_init_section(const char *name) { +#ifndef CONFIG_MODULE_UNLOAD + return strstarts(name, ".init") || module_exit_section(name); +#else return strstarts(name, ".init"); +#endif } bool __weak module_exit_section(const char *name) @@ -3121,11 +3125,6 @@ static int rewrite_section_headers(struct load_info *info, int flags) */ shdr->sh_addr = (size_t)info->hdr + shdr->sh_offset; -#ifndef CONFIG_MODULE_UNLOAD - /* Don't load .exit sections */ - if (module_exit_section(info->secstrings+shdr->sh_name)) - shdr->sh_flags &= ~(unsigned long)SHF_ALLOC; -#endif } /* Track but don't keep modinfo and version sections. */