aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-11-06 09:31:12 +0000
committerAlan Modra <amodra@gmail.com>2012-11-06 09:31:12 +0000
commitb374d0f8d9c2472b083fbb4241a6877d2b1f23d1 (patch)
treef9ef9db0a8ec97bbc221e676d16945e49b805714
parent01f2564af3a6b4c5c19e841406f3bd91d690d594 (diff)
downloadgdb-b374d0f8d9c2472b083fbb4241a6877d2b1f23d1.zip
gdb-b374d0f8d9c2472b083fbb4241a6877d2b1f23d1.tar.gz
gdb-b374d0f8d9c2472b083fbb4241a6877d2b1f23d1.tar.bz2
PR binutils/14567
* opncls.c (opncls_iovec): Forward declare. (_bfd_new_bfd_contained_in): If using opncls_iovec, copy iostream to new bfd.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/opncls.c4
2 files changed, 11 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index cea4177..02a6eab 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,12 @@
2012-11-06 Alan Modra <amodra@gmail.com>
+ PR binutils/14567
+ * opncls.c (opncls_iovec): Forward declare.
+ (_bfd_new_bfd_contained_in): If using opncls_iovec, copy iostream
+ to new bfd.
+
+2012-11-06 Alan Modra <amodra@gmail.com>
+
* mach-o.c (bfd_mach_o_close_and_cleanup): Don't call
_bfd_generic_close_and_cleanup for mach_o_fat archives.
diff --git a/bfd/opncls.c b/bfd/opncls.c
index fdccba3..8fd9ac8 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -107,6 +107,8 @@ _bfd_new_bfd (void)
return nbfd;
}
+static const struct bfd_iovec opncls_iovec;
+
/* Allocate a new BFD as a member of archive OBFD. */
bfd *
@@ -119,6 +121,8 @@ _bfd_new_bfd_contained_in (bfd *obfd)
return NULL;
nbfd->xvec = obfd->xvec;
nbfd->iovec = obfd->iovec;
+ if (obfd->iovec == &opncls_iovec)
+ nbfd->iostream = obfd->iostream;
nbfd->my_archive = obfd;
nbfd->direction = read_direction;
nbfd->target_defaulted = obfd->target_defaulted;