* elflink.c (elf_link_add_object_symbols): Don't assume version

indices are consecutive.
This commit is contained in:
Paul Brook 2004-11-15 12:39:01 +00:00
parent f4a6705cf8
commit b23e50e23e
2 changed files with 17 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2004-11-15 Paul Brook <paul@codesourcery.com>
* elflink.c (elf_link_add_object_symbols): Don't assume version
indices are consecutive.
2004-11-14 Richard Sandiford <rsandifo@redhat.com>
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Deal with

View File

@ -3518,20 +3518,23 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
if (isym->st_shndx != SHN_UNDEF)
{
if (vernum > elf_tdata (abfd)->dynverdef_hdr.sh_info)
{
(*_bfd_error_handler)
(_("%B: %s: invalid version %u (max %d)"),
abfd, name, vernum,
elf_tdata (abfd)->dynverdef_hdr.sh_info);
bfd_set_error (bfd_error_bad_value);
goto error_free_vers;
}
if (vernum > elf_tdata (abfd)->cverdefs)
verstr = NULL;
else if (vernum > 1)
verstr =
elf_tdata (abfd)->verdef[vernum - 1].vd_nodename;
else
verstr = "";
if (verstr == NULL)
{
(*_bfd_error_handler)
(_("%B: %s: invalid version %u (max %d)"),
abfd, name, vernum,
elf_tdata (abfd)->cverdefs);
bfd_set_error (bfd_error_bad_value);
goto error_free_vers;
}
}
else
{