X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felfcode.h;h=30bda73d86d19c20657beb9d344a63228732b769;hb=5d3055ad4f759240ae4b865a49f6283d02caf801;hp=cc55c866d6f40efccdefc2c444310b5425798926;hpb=fe78531dcfcd709286a292c7707b987685f61919;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elfcode.h b/bfd/elfcode.h index cc55c866d6..30bda73d86 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -633,8 +633,9 @@ elf_object_p (bfd *abfd) if (i_ehdrp->e_shnum == SHN_UNDEF) { i_ehdrp->e_shnum = i_shdr.sh_size; - if (i_ehdrp->e_shnum != i_shdr.sh_size - || i_ehdrp->e_shnum == 0) + if (i_ehdrp->e_shnum >= SHN_LORESERVE + || i_ehdrp->e_shnum != i_shdr.sh_size + || i_ehdrp->e_shnum == 0) goto got_wrong_format_error; }