+2017-09-05 Nick Clifton <nickc@redhat.com>
+
+ Import from mainline:
+
+ PR binutils/22032
+ * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
+ before _close_and_cleanup. Call iovec->bclose after.
+ (bfd_close): Remove code common to, and call, bfd_close_all_done.
+
2017-09-04 Nick Clifton <nickc@redhat.com>
Import from mainline:
bfd_boolean
bfd_close (bfd *abfd)
{
- bfd_boolean ret;
-
if (bfd_write_p (abfd))
{
if (! BFD_SEND_FMT (abfd, _bfd_write_contents, (abfd)))
return FALSE;
}
- if (! BFD_SEND (abfd, _close_and_cleanup, (abfd)))
- return FALSE;
-
- ret = abfd->iovec->bclose (abfd) == 0;
-
- if (ret)
- _maybe_make_executable (abfd);
-
- _bfd_delete_bfd (abfd);
-
- return ret;
+ return bfd_close_all_done (abfd);
}
/*
{
bfd_boolean ret;
- ret = bfd_cache_close (abfd);
+ if (! BFD_SEND (abfd, _close_and_cleanup, (abfd)))
+ return FALSE;
+
+ ret = abfd->iovec->bclose (abfd) == 0;
if (ret)
_maybe_make_executable (abfd);