/* 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.
(*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))