aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-11-15 12:39:01 +0000
committerPaul Brook <paul@codesourcery.com>2004-11-15 12:39:01 +0000
commitb23e50e23eee077dfbfdad40ec2d92a546fb19fe (patch)
tree20d3bf54c1336dd76411e639542baadc08f1a791
parentf4a6705cf87d44e639f82031a03dfccb3c3c621e (diff)
downloadgdb-b23e50e23eee077dfbfdad40ec2d92a546fb19fe.zip
gdb-b23e50e23eee077dfbfdad40ec2d92a546fb19fe.tar.gz
gdb-b23e50e23eee077dfbfdad40ec2d92a546fb19fe.tar.bz2
* elflink.c (elf_link_add_object_symbols): Don't assume version
indices are consecutive.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.c17
2 files changed, 15 insertions, 7 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 43d5e45..8c46cd6 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/elflink.c b/bfd/elflink.c
index e5c9d9f..4f2d096 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -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)
+ 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)->dynverdef_hdr.sh_info);
+ elf_tdata (abfd)->cverdefs);
bfd_set_error (bfd_error_bad_value);
goto error_free_vers;
}
- else if (vernum > 1)
- verstr =
- elf_tdata (abfd)->verdef[vernum - 1].vd_nodename;
- else
- verstr = "";
}
else
{