diff options
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/module.c b/kernel/module.c index fe748a86d452..5842a71cf052 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -1187,7 +1187,8 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect, | |||
1187 | 1187 | ||
1188 | /* Count loaded sections and allocate structures */ | 1188 | /* Count loaded sections and allocate structures */ |
1189 | for (i = 0; i < nsect; i++) | 1189 | for (i = 0; i < nsect; i++) |
1190 | if (sechdrs[i].sh_flags & SHF_ALLOC) | 1190 | if (sechdrs[i].sh_flags & SHF_ALLOC |
1191 | && sechdrs[i].sh_size) | ||
1191 | nloaded++; | 1192 | nloaded++; |
1192 | size[0] = ALIGN(sizeof(*sect_attrs) | 1193 | size[0] = ALIGN(sizeof(*sect_attrs) |
1193 | + nloaded * sizeof(sect_attrs->attrs[0]), | 1194 | + nloaded * sizeof(sect_attrs->attrs[0]), |
@@ -1207,6 +1208,8 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect, | |||
1207 | for (i = 0; i < nsect; i++) { | 1208 | for (i = 0; i < nsect; i++) { |
1208 | if (! (sechdrs[i].sh_flags & SHF_ALLOC)) | 1209 | if (! (sechdrs[i].sh_flags & SHF_ALLOC)) |
1209 | continue; | 1210 | continue; |
1211 | if (!sechdrs[i].sh_size) | ||
1212 | continue; | ||
1210 | sattr->address = sechdrs[i].sh_addr; | 1213 | sattr->address = sechdrs[i].sh_addr; |
1211 | sattr->name = kstrdup(secstrings + sechdrs[i].sh_name, | 1214 | sattr->name = kstrdup(secstrings + sechdrs[i].sh_name, |
1212 | GFP_KERNEL); | 1215 | GFP_KERNEL); |
@@ -1992,12 +1995,14 @@ static inline unsigned long layout_symtab(struct module *mod, | |||
1992 | Elf_Shdr *sechdrs, | 1995 | Elf_Shdr *sechdrs, |
1993 | unsigned int symindex, | 1996 | unsigned int symindex, |
1994 | unsigned int strindex, | 1997 | unsigned int strindex, |
1995 | const Elf_Hdr *hdr, | 1998 | const Elf_Ehdr *hdr, |
1996 | const char *secstrings, | 1999 | const char *secstrings, |
1997 | unsigned long *pstroffs, | 2000 | unsigned long *pstroffs, |
1998 | unsigned long *strmap) | 2001 | unsigned long *strmap) |
1999 | { | 2002 | { |
2003 | return 0; | ||
2000 | } | 2004 | } |
2005 | |||
2001 | static inline void add_kallsyms(struct module *mod, | 2006 | static inline void add_kallsyms(struct module *mod, |
2002 | Elf_Shdr *sechdrs, | 2007 | Elf_Shdr *sechdrs, |
2003 | unsigned int shnum, | 2008 | unsigned int shnum, |
@@ -2081,9 +2086,8 @@ static noinline struct module *load_module(void __user *umod, | |||
2081 | struct module *mod; | 2086 | struct module *mod; |
2082 | long err = 0; | 2087 | long err = 0; |
2083 | void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */ | 2088 | void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */ |
2084 | #ifdef CONFIG_KALLSYMS | ||
2085 | unsigned long symoffs, stroffs, *strmap; | 2089 | unsigned long symoffs, stroffs, *strmap; |
2086 | #endif | 2090 | |
2087 | mm_segment_t old_fs; | 2091 | mm_segment_t old_fs; |
2088 | 2092 | ||
2089 | DEBUGP("load_module: umod=%p, len=%lu, uargs=%p\n", | 2093 | DEBUGP("load_module: umod=%p, len=%lu, uargs=%p\n", |