diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/module.c b/kernel/module.c index 91f3ebe230e3..ab07f67de996 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -2225,11 +2225,13 @@ static int rewrite_section_headers(struct load_info *info) | |||
2225 | if (strstarts(info->secstrings+shdr->sh_name, ".exit")) | 2225 | if (strstarts(info->secstrings+shdr->sh_name, ".exit")) |
2226 | shdr->sh_flags &= ~(unsigned long)SHF_ALLOC; | 2226 | shdr->sh_flags &= ~(unsigned long)SHF_ALLOC; |
2227 | #endif | 2227 | #endif |
2228 | /* Don't keep modinfo and version sections. */ | ||
2229 | if (!strcmp(info->secstrings+shdr->sh_name, "__versions") | ||
2230 | || !strcmp(info->secstrings+shdr->sh_name, ".modinfo")) | ||
2231 | shdr->sh_flags &= ~(unsigned long)SHF_ALLOC; | ||
2232 | } | 2228 | } |
2229 | |||
2230 | /* Track but don't keep modinfo and version sections. */ | ||
2231 | info->index.vers = find_sec(info->hdr, info->sechdrs, info->secstrings, "__versions"); | ||
2232 | info->index.info = find_sec(info->hdr, info->sechdrs, info->secstrings, ".modinfo"); | ||
2233 | info->sechdrs[info->index.info].sh_flags &= ~(unsigned long)SHF_ALLOC; | ||
2234 | info->sechdrs[info->index.vers].sh_flags &= ~(unsigned long)SHF_ALLOC; | ||
2233 | return 0; | 2235 | return 0; |
2234 | } | 2236 | } |
2235 | 2237 | ||
@@ -2282,8 +2284,6 @@ static struct module *setup_load_info(struct load_info *info) | |||
2282 | return ERR_PTR(-ENOEXEC); | 2284 | return ERR_PTR(-ENOEXEC); |
2283 | } | 2285 | } |
2284 | 2286 | ||
2285 | info->index.vers = find_sec(info->hdr, info->sechdrs, info->secstrings, "__versions"); | ||
2286 | info->index.info = find_sec(info->hdr, info->sechdrs, info->secstrings, ".modinfo"); | ||
2287 | info->index.pcpu = find_pcpusec(info->hdr, info->sechdrs, info->secstrings); | 2287 | info->index.pcpu = find_pcpusec(info->hdr, info->sechdrs, info->secstrings); |
2288 | 2288 | ||
2289 | /* Check module struct version now, before we try to use module. */ | 2289 | /* Check module struct version now, before we try to use module. */ |