aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/kernel/module.c b/kernel/module.c
index a1d2ed8bab93..79a526dd1b11 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2285,7 +2285,7 @@ static void layout_symtab(struct module *mod, struct load_info *info)
2285 Elf_Shdr *symsect = info->sechdrs + info->index.sym; 2285 Elf_Shdr *symsect = info->sechdrs + info->index.sym;
2286 Elf_Shdr *strsect = info->sechdrs + info->index.str; 2286 Elf_Shdr *strsect = info->sechdrs + info->index.str;
2287 const Elf_Sym *src; 2287 const Elf_Sym *src;
2288 unsigned int i, nsrc, ndst, strtab_size; 2288 unsigned int i, nsrc, ndst, strtab_size = 0;
2289 2289
2290 /* Put symbol section at end of init part of module. */ 2290 /* Put symbol section at end of init part of module. */
2291 symsect->sh_flags |= SHF_ALLOC; 2291 symsect->sh_flags |= SHF_ALLOC;
@@ -2296,9 +2296,6 @@ static void layout_symtab(struct module *mod, struct load_info *info)
2296 src = (void *)info->hdr + symsect->sh_offset; 2296 src = (void *)info->hdr + symsect->sh_offset;
2297 nsrc = symsect->sh_size / sizeof(*src); 2297 nsrc = symsect->sh_size / sizeof(*src);
2298 2298
2299 /* strtab always starts with a nul, so offset 0 is the empty string. */
2300 strtab_size = 1;
2301
2302 /* Compute total space required for the core symbols' strtab. */ 2299 /* Compute total space required for the core symbols' strtab. */
2303 for (ndst = i = 0; i < nsrc; i++) { 2300 for (ndst = i = 0; i < nsrc; i++) {
2304 if (i == 0 || 2301 if (i == 0 ||
@@ -2340,7 +2337,6 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
2340 mod->core_symtab = dst = mod->module_core + info->symoffs; 2337 mod->core_symtab = dst = mod->module_core + info->symoffs;
2341 mod->core_strtab = s = mod->module_core + info->stroffs; 2338 mod->core_strtab = s = mod->module_core + info->stroffs;
2342 src = mod->symtab; 2339 src = mod->symtab;
2343 *s++ = 0;
2344 for (ndst = i = 0; i < mod->num_symtab; i++) { 2340 for (ndst = i = 0; i < mod->num_symtab; i++) {
2345 if (i == 0 || 2341 if (i == 0 ||
2346 is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum)) { 2342 is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum)) {