* Check fclose return value for errors.
libbfd.h: bfd_cache_close now returns a boolean.
cache.c (bfd_cache_delete): return fclose success value.
(bfd_cache_close): return bfd_cache_delete return value.
opncls.c (bfd_close, bfd_close_all_done): return result of
bfd_cache_close.
+Fri Oct 23 13:55:35 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Check fclose return value for errors.
+ libbfd.h: bfd_cache_close now returns a boolean.
+ cache.c (bfd_cache_delete): return fclose success value.
+ (bfd_cache_close): return bfd_cache_delete return value.
+ opncls.c (bfd_close, bfd_close_all_done): return result of
+ bfd_cache_close.
+
Fri Oct 23 10:32:36 1992 Steve Chamberlain (sac@thepub.cygnus.com)
* seclet.c (rel): don't load sections without the SEC_LOAD bit.
-
/* BFD library -- caching of file descriptors.
- Copyright (C) 1990-1991 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
*/
-/* $Id$ */
-
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
BFD_CACHE_MAX_OPEN macro
DESCRIPTION
- The maxiumum number of files which the cache will keep open at
+ The maximum number of files which the cache will keep open at
one time.
.#define BFD_CACHE_MAX_OPEN 10
*
*/
-static void bfd_cache_delete();
+static boolean EXFUN(bfd_cache_delete,(bfd *));
static void
}
kill->where = ftell((FILE *)(kill->iostream));
- bfd_cache_delete(kill);
+ (void) bfd_cache_delete(kill);
}
/* Cuts the BFD abfd out of the chain in the cache */
if (cache_sentinel == abfd) cache_sentinel = (bfd *)NULL;
}
-static void
+static boolean
DEFUN(bfd_cache_delete,(abfd),
bfd *abfd)
{
- fclose ((FILE *)(abfd->iostream));
+ boolean ret;
+
+ if (fclose ((FILE *)(abfd->iostream)) == EOF)
+ ret = false;
+ else
+ ret = true;
snip (abfd);
abfd->iostream = NULL;
open_files--;
bfd_last_cache = 0;
+ return ret;
}
static bfd *
then close it too.
SYNOPSIS
- void bfd_cache_close (bfd *);
+ boolean bfd_cache_close (bfd *);
+
+RETURNS
+ <<false>> is returned if closing the file fails, <<true>> is
+ returned if all is well.
*/
-void
+boolean
DEFUN(bfd_cache_close,(abfd),
bfd *abfd)
{
/* If this file is open then remove from the chain */
if (abfd->iostream)
{
- bfd_cache_delete(abfd);
+ return bfd_cache_delete(abfd);
+ }
+ else
+ {
+ return true;
}
}
PROTO(PTR, bfd_realloc,(bfd *abfd, PTR orig, bfd_size_type new));
PROTO(void, bfd_alloc_grow,(bfd *abfd, PTR thing, bfd_size_type size));
PROTO(PTR, bfd_alloc_finish,(bfd *abfd));
+PROTO(PTR, bfd_alloc_by_size_t,(bfd *abfd, size_t wanted));
#define bfd_release(x,y) (void) obstack_free(&(x->memory),y)
(FILE*)(bfd_last_cache->iostream): \
bfd_cache_lookup_worker(x))
void EXFUN(bfd_cache_init , (bfd *));
-void EXFUN(bfd_cache_close , (bfd *));
+boolean EXFUN(bfd_cache_close , (bfd *));
FILE* EXFUN(bfd_open_file, (bfd *));
FILE *EXFUN(bfd_cache_lookup_worker, (bfd *));
void EXFUN(bfd_constructor_entry, (bfd *abfd,
, (CONST bfd_arch_info_type *a,
CONST bfd_arch_info_type *b));
boolean EXFUN(bfd_default_scan, (CONST struct bfd_arch_info *, CONST char *));
+struct elf_internal_shdr *EXFUN(bfd_elf_find_section , (bfd *abfd, char *name));