aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-03-13 05:02:17 -0400
committerRusty Russell <rusty@rustcorp.com.au>2008-05-01 07:14:59 -0400
commitea01e798e2d27fd04142e0473ca36570fa9d9218 (patch)
tree717ad87d4c38dd6bed15ba4dfdfaea8f33411367
parenta58730c42174672fe0012a4edbe3e38f94ef2bad (diff)
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: Jan Beulich <jbeulich@novell.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r--include/linux/module.h2
-rw-r--r--kernel/module.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index a29c2ebb7c38..3e03b1acbc94 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -190,7 +190,7 @@ void *__symbol_get_gpl(const char *symbol);
190 extern typeof(sym) sym; \ 190 extern typeof(sym) sym; \
191 __CRC_SYMBOL(sym, sec) \ 191 __CRC_SYMBOL(sym, sec) \
192 static const char __kstrtab_##sym[] \ 192 static const char __kstrtab_##sym[] \
193 __attribute__((section("__ksymtab_strings"))) \ 193 __attribute__((section("__ksymtab_strings"), aligned(1))) \
194 = MODULE_SYMBOL_PREFIX #sym; \ 194 = MODULE_SYMBOL_PREFIX #sym; \
195 static const struct kernel_symbol __ksymtab_##sym \ 195 static const struct kernel_symbol __ksymtab_##sym \
196 __used \ 196 __used \
diff --git a/kernel/module.c b/kernel/module.c
index b0d7c2a41bd9..031bf26af8ea 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1828,8 +1828,9 @@ static struct module *load_module(void __user *umod,
1828 unwindex = find_sec(hdr, sechdrs, secstrings, ARCH_UNWIND_SECTION_NAME); 1828 unwindex = find_sec(hdr, sechdrs, secstrings, ARCH_UNWIND_SECTION_NAME);
1829#endif 1829#endif
1830 1830
1831 /* Don't keep modinfo section */ 1831 /* Don't keep modinfo and version sections. */
1832 sechdrs[infoindex].sh_flags &= ~(unsigned long)SHF_ALLOC; 1832 sechdrs[infoindex].sh_flags &= ~(unsigned long)SHF_ALLOC;
1833 sechdrs[versindex].sh_flags &= ~(unsigned long)SHF_ALLOC;
1833#ifdef CONFIG_KALLSYMS 1834#ifdef CONFIG_KALLSYMS
1834 /* Keep symbol and string tables for decoding later. */ 1835 /* Keep symbol and string tables for decoding later. */
1835 sechdrs[symindex].sh_flags |= SHF_ALLOC; 1836 sechdrs[symindex].sh_flags |= SHF_ALLOC;