OSDN Git Service

kallsyms: reduce size a little on 64-bit
authorJan Beulich <JBeulich@suse.com>
Mon, 3 Sep 2018 12:09:34 +0000 (06:09 -0600)
committer0ranko0P <ranko0p@outlook.com>
Wed, 4 Dec 2019 17:16:47 +0000 (01:16 +0800)
Both kallsyms_num_syms and kallsyms_markers[] don't really need to use
unsigned long as their (base) types; unsigned int fully suffices.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
kernel/kallsyms.c
scripts/kallsyms.c

index 5c5987f..83fc965 100644 (file)
@@ -44,13 +44,13 @@ extern const u8 kallsyms_names[] __weak;
  * Tell the compiler that the count isn't in the small data section if the arch
  * has one (eg: FRV).
  */
-extern const unsigned long kallsyms_num_syms
+extern const unsigned int kallsyms_num_syms
 __attribute__((weak, section(".rodata")));
 
 extern const u8 kallsyms_token_table[] __weak;
 extern const u16 kallsyms_token_index[] __weak;
 
-extern const unsigned long kallsyms_markers[] __weak;
+extern const unsigned int kallsyms_markers[] __weak;
 
 static inline int is_kernel_inittext(unsigned long addr)
 {
index c101b3a..8ad192f 100644 (file)
@@ -372,7 +372,7 @@ static void write_src(void)
        printf("\n");
 
        output_label("kallsyms_num_syms");
-       printf("\tPTR\t%u\n", table_cnt);
+       printf("\t.long\t%u\n", table_cnt);
        printf("\n");
 
        /* table of offset markers, that give the offset in the compressed stream
@@ -401,7 +401,7 @@ static void write_src(void)
 
        output_label("kallsyms_markers");
        for (i = 0; i < ((table_cnt + 255) >> 8); i++)
-               printf("\tPTR\t%d\n", markers[i]);
+               printf("\t.long\t%u\n", markers[i]);
        printf("\n");
 
        free(markers);