aboutsummaryrefslogtreecommitdiff
path: root/bfd/libbfd.h
diff options
context:
space:
mode:
authorDavid MacKenzie <djm@cygnus>1994-02-05 02:46:12 +0000
committerDavid MacKenzie <djm@cygnus>1994-02-05 02:46:12 +0000
commit0ee3427297272a636e7ef8378182a38d64ed7b7d (patch)
tree4aad622fe6694ef2d197613a4c15a17d349507ee /bfd/libbfd.h
parent0b2f8d2edd598eb8f013e8b61fd49def1d908281 (diff)
downloadgdb-0ee3427297272a636e7ef8378182a38d64ed7b7d.zip
gdb-0ee3427297272a636e7ef8378182a38d64ed7b7d.tar.gz
gdb-0ee3427297272a636e7ef8378182a38d64ed7b7d.tar.bz2
* libbfd.c (bfd_zmalloc): Call bfd_xmalloc instead of malloc.
(bfd_xmalloc, bfd_xmalloc_by_size_t): Functions deleted. * libbfd-in.h: Define them as macros calling xmalloc and declare xmalloc. * libbfd.h: Rebuilt. * ecofflink.c hash.c ieee.c opncls.c (obstack_chunk_alloc): Define to be xmalloc, not bfd_xmalloc_by_size_t.
Diffstat (limited to 'bfd/libbfd.h')
-rw-r--r--bfd/libbfd.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index ed8464b..8babcf3 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -73,7 +73,17 @@ struct areltdata {
#define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size)
+/* There is major inconsistency in how running out of memory is handled.
+ Some routines return a NULL, and set bfd_error to no_memory.
+ However, obstack routines can't do this ... */
+
char *bfd_zmalloc PARAMS ((bfd_size_type size));
+/* From libiberty. */
+extern PTR xmalloc PARAMS ((size_t));
+/* SIZE is bfd_size_type. */
+#define bfd_xmalloc(size) xmalloc ((size_t) size)
+/* SIZE is size_t. */
+#define bfd_xmalloc_by_size_t(size) xmalloc (size)
/* These routines allocate and free things on the BFD's obstack. Note
that realloc can never occur in place. */
@@ -260,12 +270,6 @@ extern bfd_target *bfd_default_vector[];
void
bfd_check_init PARAMS ((void));
-PTR
-bfd_xmalloc PARAMS ((bfd_size_type size));
-
-PTR
-bfd_xmalloc_by_size_t PARAMS ((size_t size));
-
void
bfd_write_bigendian_4byte_int PARAMS ((bfd *abfd, int i));