X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fmod%2Fmodpost.c;h=93ac52adb4980b3d23a0b40acd6800e48f75b349;hb=614ee1f61f667b02165c1ae0c1357048dc6d94a0;hp=ee58ded021d77d815eaa350207befda54186c008;hpb=cb7e51d8b1f8e2390970f4bb7d095c414b1bf3cf;p=linux-2.6-omap-h63xx.git diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index ee58ded021d..93ac52adb49 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -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; @@ -1121,6 +1131,7 @@ static int initexit_section_ref_ok(const char *name) ".machvec", /* ia64 + powerpc uses these */ ".machine.desc", ".opd", /* See comment [OPD] */ + "__dbe_table", ".parainstructions", ".pdr", ".plt", /* seen on ARCH=um build on x86_64. Harmless */