From 58142f101dd3256f4741f60a6b25672d79b91371 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 1 Dec 1995 19:48:10 +0000 Subject: * libbfd.c (bfd_malloc, bfd_realloc): New functions. (bfd_zmalloc): Return PTR, not char *. Take size_t, not bfd_size_type. * libbfd-in.h (bfd_malloc, bfd_realloc): Declare. (bfd_zmalloc): Change declaration. * libbfd.h: Rebuild. * Many files: Use bfd_malloc and bfd_realloc rather than malloc and realloc. Don't set bfd_error_no_memory if they fail. --- bfd/elfcode.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'bfd/elfcode.h') diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 0b28608..2e35f90 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -891,12 +891,9 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) /* Temporarily allocate room for the raw ELF symbols. */ x_symp = ((Elf_External_Sym *) - malloc (symcount * sizeof (Elf_External_Sym))); + bfd_malloc (symcount * sizeof (Elf_External_Sym))); if (x_symp == NULL && symcount != 0) - { - bfd_set_error (bfd_error_no_memory); - goto error_return; - } + goto error_return; if (bfd_read ((PTR) x_symp, sizeof (Elf_External_Sym), symcount, abfd) != symcount * sizeof (Elf_External_Sym)) @@ -1053,12 +1050,9 @@ elf_slurp_reloc_table (abfd, asect, symbols) && (asect->reloc_count == d->rel_hdr.sh_size / d->rel_hdr.sh_entsize)); - allocated = (PTR) malloc ((size_t) d->rel_hdr.sh_size); + allocated = (PTR) bfd_malloc ((size_t) d->rel_hdr.sh_size); if (allocated == NULL) - { - bfd_set_error (bfd_error_no_memory); - goto error_return; - } + goto error_return; if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0 || (bfd_read (allocated, 1, d->rel_hdr.sh_size, abfd) -- cgit v1.1