aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-12-01 19:48:10 +0000
committerIan Lance Taylor <ian@airs.com>1995-12-01 19:48:10 +0000
commit58142f101dd3256f4741f60a6b25672d79b91371 (patch)
treee7ca6dd97a327093be2076160bebd1baaf20d8a4 /bfd/elfcode.h
parent2eec871057c921ceb38fb0b7f3cd78e84b700808 (diff)
downloadgdb-58142f101dd3256f4741f60a6b25672d79b91371.zip
gdb-58142f101dd3256f4741f60a6b25672d79b91371.tar.gz
gdb-58142f101dd3256f4741f60a6b25672d79b91371.tar.bz2
* 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.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h14
1 files changed, 4 insertions, 10 deletions
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)