]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - scripts/mod/modpost.c
Merge branch 'for-2.6.24' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer...
[linux-2.6-omap-h63xx.git] / scripts / mod / modpost.c
index 6c145d6e89dec73d2b595a9895825a70c9bd6efe..93ac52adb4980b3d23a0b40acd6800e48f75b349 100644 (file)
@@ -268,6 +268,9 @@ static struct symbol *sym_add_exported(const char *name, struct module *mod,
                             "was in %s%s\n", mod->name, name,
                             s->module->name,
                             is_vmlinux(s->module->name) ?"":".ko");
+               } else {
+                       /* In case Modules.symvers was out of date */
+                       s->module = mod;
                }
        }
        s->preloaded = 0;
@@ -381,6 +384,12 @@ static int parse_elf(struct elf_info *info, const char *filename)
        sechdrs = (void *)hdr + hdr->e_shoff;
        info->sechdrs = sechdrs;
 
+       /* Check if file offset is correct */
+       if (hdr->e_shoff > info->size) {
+               fatal("section header offset=%u in file '%s' is bigger then filesize=%lu\n", hdr->e_shoff, filename, info->size);
+               return 0;
+       }
+
        /* Fix endianness in section headers */
        for (i = 0; i < hdr->e_shnum; i++) {
                sechdrs[i].sh_type   = TO_NATIVE(sechdrs[i].sh_type);
@@ -709,6 +718,7 @@ static int secref_whitelist(const char *modname, const char *tosec,
 
        /* Check for pattern 0 */
        if ((strncmp(fromsec, ".text.init.refok", strlen(".text.init.refok")) == 0) ||
+           (strncmp(fromsec, ".exit.text.refok", strlen(".exit.text.refok")) == 0) ||
            (strncmp(fromsec, ".data.init.refok", strlen(".data.init.refok")) == 0))
                return 1;