[PATCH] Fix bug in crc symbol generating of kernel and modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

   The scripts/genksyms/genksyms.c uses hardcoded "__crc_" prefix for
crc symbols in kernel and modules. The prefix should be replaced by 
"MODULE_SYMBOL_PREFIX##__crc_" otherwise there will be warnings when
MODULE_SYMBOL_PREFIX is not NULL.

   I am sorry my last patch for this issue is actually wrong. I revert
it in this patch.

Signed-off-by: Luke Yang <[email protected]>

diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c
index 416a694..ef4ba91 100644
--- a/scripts/genksyms/genksyms.c
+++ b/scripts/genksyms/genksyms.c
@@ -32,6 +32,7 @@
 #endif /* __GNU_LIBRARY__ */

 #include "genksyms.h"
+#include "../mod/elfconfig.h"

 /*----------------------------------------------------------------------*/

@@ -458,7 +459,7 @@ export_symbol(const char *name)
        fputs(">\n", debugfile);

       /* Used as a linker script. */
-      printf("__crc_%s = 0x%08lx ;\n", name, crc);
+     printf("%s__crc_%s = 0x%08lx ;\n", MODULE_SYMBOL_PREFIX, name, crc);
     }
 }

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index f70ff13..ac595ce 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -326,8 +326,8 @@ parse_elf_finish(struct elf_info *info)
        release_file(info->hdr, info->size);
 }

-#define CRC_PFX     "__crc_"
-#define KSYMTAB_PFX "__ksymtab_"
+#define CRC_PFX     MODULE_SYMBOL_PREFIX "__crc_"
+#define KSYMTAB_PFX MODULE_SYMBOL_PREFIX "__ksymtab_"

 void
 handle_modversions(struct module *mod, struct elf_info *info,

--
Best regards,
Luke Yang
[email protected]; [email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux