aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-06-17 09:57:18 +0000
committerNick Clifton <nickc@redhat.com>2003-06-17 09:57:18 +0000
commitb613960add9c5795487fac9952fe4a999e3c7d72 (patch)
treed66e01c08aad810465062e268ac52af2107d9309 /bfd
parent3d6f9012bb716b467d0e67172c2658c02c1ad9fd (diff)
downloadgdb-b613960add9c5795487fac9952fe4a999e3c7d72.zip
gdb-b613960add9c5795487fac9952fe4a999e3c7d72.tar.gz
gdb-b613960add9c5795487fac9952fe4a999e3c7d72.tar.bz2
(elf_gc_record_vtentry): Allocate an extra element in the vtable_entries_used
array to allow for the accessing the largest element.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.h7
2 files changed, 10 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 23350fd..c6b6b1e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2003-06-17 Nick Clifton <nickc@redhat.com>
+
+ * elflink.h (elf_gc_record_vtentry): Allocate an extra element
+ in the vtable_entries_used array to allow for the accessing
+ the largest element.
+
2003-06-17 Alan Modra <amodra@bigpond.net.au>
* elf64-ppc.c (struct ppc_link_hash_table): Remove top_index. Modify
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 8acb7a9..b960c73 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -6283,7 +6283,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend)
struct elf_backend_data *bed = get_elf_backend_data (abfd);
unsigned int log_file_align = bed->s->log_file_align;
- if (addend >= h->vtable_entries_size)
+ if (addend > h->vtable_entries_size)
{
size_t size, bytes;
bfd_boolean *ptr = h->vtable_entries_used;
@@ -6304,8 +6304,9 @@ elf_gc_record_vtentry (abfd, sec, h, addend)
}
/* Allocate one extra entry for use as a "done" flag for the
- consolidation pass. */
- bytes = ((size >> log_file_align) + 1) * sizeof (bfd_boolean);
+ consolidation pass and another extra entry because we are
+ going to write up to and including 'size' entries. */
+ bytes = ((size >> log_file_align) + 2) * sizeof (bfd_boolean);
if (ptr)
{