diff options
Diffstat (limited to 'bfd/opncls.c')
-rw-r--r-- | bfd/opncls.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/bfd/opncls.c b/bfd/opncls.c index 602dc80..b7b9d8f 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -1043,79 +1043,6 @@ bfd_make_readable (bfd *abfd) } /* -FUNCTION - bfd_alloc - -SYNOPSIS - void *bfd_alloc (bfd *abfd, bfd_size_type wanted); - -DESCRIPTION - Allocate a block of @var{wanted} bytes of memory attached to - <<abfd>> and return a pointer to it. -*/ - -void * -bfd_alloc (bfd *abfd, bfd_size_type size) -{ - void *ret; - unsigned long ul_size = (unsigned long) size; - - if (size != ul_size - /* Note - although objalloc_alloc takes an unsigned long as its - argument, internally the size is treated as a signed long. This can - lead to problems where, for example, a request to allocate -1 bytes - can result in just 1 byte being allocated, rather than - ((unsigned long) -1) bytes. Also memory checkers will often - complain about attempts to allocate a negative amount of memory. - So to stop these problems we fail if the size is negative. */ - || ((signed long) ul_size) < 0) - { - bfd_set_error (bfd_error_no_memory); - return NULL; - } - - ret = objalloc_alloc ((struct objalloc *) abfd->memory, ul_size); - if (ret == NULL) - bfd_set_error (bfd_error_no_memory); - else - abfd->alloc_size += size; - return ret; -} - -/* -FUNCTION - bfd_zalloc - -SYNOPSIS - void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); - -DESCRIPTION - Allocate a block of @var{wanted} bytes of zeroed memory - attached to <<abfd>> and return a pointer to it. -*/ - -void * -bfd_zalloc (bfd *abfd, bfd_size_type size) -{ - void *res; - - res = bfd_alloc (abfd, size); - if (res) - memset (res, 0, (size_t) size); - return res; -} - -/* Free a block allocated for a BFD. - Note: Also frees all more recently allocated blocks! */ - -void -bfd_release (bfd *abfd, void *block) -{ - objalloc_free_block ((struct objalloc *) abfd->memory, block); -} - - -/* GNU Extension: separate debug-info files The idea here is that a special section called .gnu_debuglink might be |