X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=scripts%2Fmod%2Fmodpost.c;h=7e62303133dc68e16eb3b1457068cdf52b5db1d2;hb=b1dbb67911fecb290db3f566281bcd9ccc9dc6df;hp=88921611b22e62e9b0792ea1cc5affe789a07964;hpb=24924f884cd36603615ea5496244e542b0b513c6;p=~andy%2Flinux diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 88921611b22..7e62303133d 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -415,8 +415,9 @@ static int parse_elf(struct elf_info *info, const char *filename) const char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; const char *secname; + int nobits = sechdrs[i].sh_type == SHT_NOBITS; - if (sechdrs[i].sh_offset > info->size) { + if (!nobits && sechdrs[i].sh_offset > info->size) { fatal("%s is truncated. sechdrs[i].sh_offset=%lu > " "sizeof(*hrd)=%zu\n", filename, (unsigned long)sechdrs[i].sh_offset, @@ -425,6 +426,8 @@ static int parse_elf(struct elf_info *info, const char *filename) } secname = secstrings + sechdrs[i].sh_name; if (strcmp(secname, ".modinfo") == 0) { + if (nobits) + fatal("%s has NOBITS .modinfo\n", filename); info->modinfo = (void *)hdr + sechdrs[i].sh_offset; info->modinfo_len = sechdrs[i].sh_size; } else if (strcmp(secname, "__ksymtab") == 0)