Commit ea01e798e2d27fd04142e0473ca36570fa9d9218

Authored by Rusty Russell
1 parent a58730c421

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>

Showing 2 changed files with 3 additions and 2 deletions Side-by-side Diff

include/linux/module.h
... ... @@ -190,7 +190,7 @@
190 190 extern typeof(sym) sym; \
191 191 __CRC_SYMBOL(sym, sec) \
192 192 static const char __kstrtab_##sym[] \
193   - __attribute__((section("__ksymtab_strings"))) \
  193 + __attribute__((section("__ksymtab_strings"), aligned(1))) \
194 194 = MODULE_SYMBOL_PREFIX #sym; \
195 195 static const struct kernel_symbol __ksymtab_##sym \
196 196 __used \
... ... @@ -1828,8 +1828,9 @@
1828 1828 unwindex = find_sec(hdr, sechdrs, secstrings, ARCH_UNWIND_SECTION_NAME);
1829 1829 #endif
1830 1830  
1831   - /* Don't keep modinfo section */
  1831 + /* Don't keep modinfo and version sections. */
1832 1832 sechdrs[infoindex].sh_flags &= ~(unsigned long)SHF_ALLOC;
  1833 + sechdrs[versindex].sh_flags &= ~(unsigned long)SHF_ALLOC;
1833 1834 #ifdef CONFIG_KALLSYMS
1834 1835 /* Keep symbol and string tables for decoding later. */
1835 1836 sechdrs[symindex].sh_flags |= SHF_ALLOC;