aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>1999-09-06 08:57:49 +0000
committerNick Clifton <nickc@redhat.com>1999-09-06 08:57:49 +0000
commitfed79cc616affa1f8b87d897616a9b9e9ae9ea99 (patch)
treea50c415a3b37de996f8d513bf360f9c7b8232a38 /bfd/elflink.h
parentd9ea9319a9b3a84bad95e318f1d669e59e70ae89 (diff)
downloadgdb-fed79cc616affa1f8b87d897616a9b9e9ae9ea99.zip
gdb-fed79cc616affa1f8b87d897616a9b9e9ae9ea99.tar.gz
gdb-fed79cc616affa1f8b87d897616a9b9e9ae9ea99.tar.bz2
use bfd memory allcation routines
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index e9ba45a..43a44da 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -6419,30 +6419,31 @@ elf_gc_record_vtentry (abfd, sec, h, addend)
/* Allocate one extra entry for use as a "done" flag for the
consolidation pass. */
- bytes = (size / FILE_ALIGN + 1) * sizeof(boolean);
+ bytes = (size / FILE_ALIGN + 1) * sizeof (boolean);
if (ptr)
{
- size_t oldbytes;
-
- ptr = realloc (ptr-1, bytes);
- if (ptr == NULL)
- return false;
+ ptr = bfd_realloc (ptr - 1, bytes);
+
+ if (ptr != NULL)
+ {
+ size_t oldbytes;
- oldbytes = (h->vtable_entries_size/FILE_ALIGN + 1) * sizeof(boolean);
- memset (((char *)ptr) + oldbytes, 0, bytes - oldbytes);
+ oldbytes = (h->vtable_entries_size/FILE_ALIGN + 1) * sizeof (boolean);
+ memset (((char *)ptr) + oldbytes, 0, bytes - oldbytes);
+ }
}
else
- {
- ptr = calloc (1, bytes);
- if (ptr == NULL)
- return false;
- }
+ ptr = bfd_zmalloc (bytes);
+ if (ptr == NULL)
+ return false;
+
/* And arrange for that done flag to be at index -1. */
- h->vtable_entries_used = ptr+1;
+ h->vtable_entries_used = ptr + 1;
h->vtable_entries_size = size;
}
+
h->vtable_entries_used[addend / FILE_ALIGN] = true;
return true;