Commit ea01e798 authored by Rusty Russell's avatar Rusty Russell

module: reduce module image and resident size

Resulting reduction (x86-64, gcc 4.1.2) with my (special purpose, i.e.
much reduced) configurations:
- 16k kernel resident size
- 180k module resident size
- 10k module image size
Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent a58730c4
...@@ -190,7 +190,7 @@ void *__symbol_get_gpl(const char *symbol); ...@@ -190,7 +190,7 @@ void *__symbol_get_gpl(const char *symbol);
extern typeof(sym) sym; \ extern typeof(sym) sym; \
__CRC_SYMBOL(sym, sec) \ __CRC_SYMBOL(sym, sec) \
static const char __kstrtab_##sym[] \ static const char __kstrtab_##sym[] \
__attribute__((section("__ksymtab_strings"))) \ __attribute__((section("__ksymtab_strings"), aligned(1))) \
= MODULE_SYMBOL_PREFIX #sym; \ = MODULE_SYMBOL_PREFIX #sym; \
static const struct kernel_symbol __ksymtab_##sym \ static const struct kernel_symbol __ksymtab_##sym \
__used \ __used \
......
...@@ -1828,8 +1828,9 @@ static struct module *load_module(void __user *umod, ...@@ -1828,8 +1828,9 @@ static struct module *load_module(void __user *umod,
unwindex = find_sec(hdr, sechdrs, secstrings, ARCH_UNWIND_SECTION_NAME); unwindex = find_sec(hdr, sechdrs, secstrings, ARCH_UNWIND_SECTION_NAME);
#endif #endif
/* Don't keep modinfo section */ /* Don't keep modinfo and version sections. */
sechdrs[infoindex].sh_flags &= ~(unsigned long)SHF_ALLOC; sechdrs[infoindex].sh_flags &= ~(unsigned long)SHF_ALLOC;
sechdrs[versindex].sh_flags &= ~(unsigned long)SHF_ALLOC;
#ifdef CONFIG_KALLSYMS #ifdef CONFIG_KALLSYMS
/* Keep symbol and string tables for decoding later. */ /* Keep symbol and string tables for decoding later. */
sechdrs[symindex].sh_flags |= SHF_ALLOC; sechdrs[symindex].sh_flags |= SHF_ALLOC;
......
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