elfcpp:/
[deliverable/binutils-gdb.git] / gdb / objfiles.c
index d0aee52b8c48f9d4a6e331958298880ff916cc2a..bc77de8635f7899665e6402541b93862d9fe76c0 100644 (file)
@@ -1,7 +1,7 @@
 /* GDB routines for manipulating objfiles.
 
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+   2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
@@ -422,9 +422,9 @@ free_objfile (struct objfile *objfile)
       (*objfile->sf->sym_finish) (objfile);
     }
 
-  /* We always close the bfd. */
+  /* We always close the bfd, unless the OBJF_KEEPBFD flag is set.  */
 
-  if (objfile->obfd != NULL)
+  if (objfile->obfd != NULL && !(objfile->flags & OBJF_KEEPBFD))
     {
       char *name = bfd_get_filename (objfile->obfd);
       if (!bfd_close (objfile->obfd))
This page took 0.025633 seconds and 4 git commands to generate.