]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
module: turn longs into ints for module sizes
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 23 Jul 2008 00:24:27 +0000 (19:24 -0500)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Jul 2008 09:24:27 +0000 (19:24 +1000)
This shrinks module.o and each *.ko file.

And finally, structure members which hold length of module
code (four such members there) and count of symbols
are converted from longs to ints.

We cannot possibly have a module where 32 bits won't
be enough to hold such counts.

For one, module loading checks module size for sanity
before loading, so such insanely big module will fail
that test first.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
include/linux/module.h
kernel/module.c

index a860a2c1f37991cfa4d5048a8cea1e10d1c33628..fce15ebd0e1cb6eca3831a77bbcc0d1887c50bc6 100644 (file)
@@ -288,10 +288,10 @@ struct module
        void *module_core;
 
        /* Here are the sizes of the init and core sections */
-       unsigned long init_size, core_size;
+       unsigned int init_size, core_size;
 
        /* The size of the executable code in each section.  */
-       unsigned long init_text_size, core_text_size;
+       unsigned int init_text_size, core_text_size;
 
        /* The handle returned from unwind_add_table. */
        void *unwind_info;
@@ -311,7 +311,7 @@ struct module
 #ifdef CONFIG_KALLSYMS
        /* We keep the symbol and string tables for kallsyms. */
        Elf_Sym *symtab;
-       unsigned long num_symtab;
+       unsigned int num_symtab;
        char *strtab;
 
        /* Section attributes */
index ea9580521eb17e7be8121906c0f38d996a557585..5c7eb0695b3ce82d2a41386c2df0970466089a3c 100644 (file)
@@ -1567,7 +1567,7 @@ static int simplify_symbols(Elf_Shdr *sechdrs,
 }
 
 /* Update size with this section: return offset. */
-static long get_offset(unsigned long *size, Elf_Shdr *sechdr)
+static long get_offset(unsigned int *size, Elf_Shdr *sechdr)
 {
        long ret;
 
@@ -2562,7 +2562,7 @@ static int m_show(struct seq_file *m, void *p)
        struct module *mod = list_entry(p, struct module, list);
        char buf[8];
 
-       seq_printf(m, "%s %lu",
+       seq_printf(m, "%s %u",
                   mod->name, mod->init_size + mod->core_size);
        print_unload_info(m, mod);