]> git.hungrycats.org Git - linux/commitdiff
kbuild: Fix a 64-bit issue in scripts/modpost.c
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Sun, 16 Feb 2003 13:42:14 +0000 (07:42 -0600)
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Sun, 16 Feb 2003 13:42:14 +0000 (07:42 -0600)
The checksums are generally 32-bit (unsigned int), though they are saved
in symbol values, which may 64-bit, so we need to convert.

Pointed out by Anton Blanchard.

scripts/modpost.c

index a2fb406872b183a50324d412ae03dad46ee4332f..976d39387ae0e0bea77349d681757cce22e12e68 100644 (file)
@@ -270,6 +270,7 @@ handle_modversions(struct module *mod, struct elf_info *info,
                   Elf_Sym *sym, const char *symname)
 {
        struct symbol *s;
+       unsigned int crc;
 
        switch (sym->st_shndx) {
        case SHN_COMMON:
@@ -279,7 +280,8 @@ handle_modversions(struct module *mod, struct elf_info *info,
        case SHN_ABS:
                /* CRC'd symbol */
                if (memcmp(symname, "__crc_", 6) == 0) {
-                       add_exported_symbol(symname+6, mod, &sym->st_value);
+                       crc = (unsigned int) sym->st_value;
+                       add_exported_symbol(symname+6, mod, &crc);
                        modversions = 1;
                }
                break;