X-Git-Url: https://oss.titaniummirror.com/gitweb?p=msp430-binutils.git;a=blobdiff_plain;f=bfd%2Fbfdwin.c;fp=bfd%2Fbfdwin.c;h=63ad5ed3f53a7023c7c8f2c67516d78f3ed8c13b;hp=a44265efa752e1f572c9644b4ef93ff1281218ac;hb=88750007d7869f178f0ba528f41efd3b74c424cf;hpb=6df9443a374e2b81278c61b8afc0a1eef7db280b diff --git a/bfd/bfdwin.c b/bfd/bfdwin.c index a44265e..63ad5ed 100644 --- a/bfd/bfdwin.c +++ b/bfd/bfdwin.c @@ -1,5 +1,5 @@ /* Support for memory-mapped windows into a BFD. - Copyright 1995, 1996, 2001, 2002, 2003, 2005, 2007 + Copyright 1995, 1996, 2001, 2002, 2003, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Written by Cygnus Support. @@ -25,10 +25,8 @@ #include "bfd.h" #include "libbfd.h" -/* Currently, if USE_MMAP is undefined, none if the window stuff is - used. Okay, so it's mis-named. At least the command-line option - "--without-mmap" is more obvious than "--without-windows" or some - such. */ +/* Currently, if USE_MMAP is undefined, none of the window stuff is + used. Enabled by --with-mmap. */ #ifdef USE_MMAP @@ -80,7 +78,7 @@ bfd_free_window (bfd_window *windowp) i->refcount--; if (debug_windows) fprintf (stderr, "freeing window @%p<%p,%lx,%p>\n", - windowp, windowp->data, windowp->size, windowp->i); + windowp, windowp->data, (unsigned long) windowp->size, windowp->i); if (i->refcount != 0) return; @@ -224,16 +222,16 @@ bfd_get_file_window (bfd *abfd, if (debug_windows) fprintf (stderr, "\n\t%s(%6ld)", i->data ? "realloc" : " malloc", (long) size_to_alloc); - i->data = bfd_realloc (i->data, size_to_alloc); + i->data = bfd_realloc_or_free (i->data, size_to_alloc); if (debug_windows) fprintf (stderr, "\t-> %p\n", i->data); - i->refcount = 1; if (i->data == NULL) { if (size_to_alloc == 0) return TRUE; return FALSE; } + i->refcount = 1; if (bfd_seek (abfd, offset, SEEK_SET) != 0) return FALSE; i->size = bfd_bread (i->data, size, abfd);