return nbfd;
}
+static const struct bfd_iovec opncls_iovec;
+
/* Allocate a new BFD as a member of archive OBFD. */
bfd *
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;
bfd_hash_table_free (&abfd->section_htab);
objalloc_free ((struct objalloc *) abfd->memory);
}
+
+ free (abfd->arelt_data);
free (abfd);
}
return -1;
}
-static int
+static bfd_boolean
opncls_bclose (struct bfd *abfd)
{
struct opncls *vec = (struct opncls *) abfd->iostream;
if (vec->close != NULL)
status = (vec->close) (abfd, vec->stream);
abfd->iostream = NULL;
- return status;
+ return status == 0;
}
static int
bfd_close (bfd *abfd)
{
bfd_boolean ret;
- bfd *nbfd;
- bfd *next;
if (bfd_write_p (abfd))
{
return FALSE;
}
- /* Close nested archives (if this bfd is a thin archive). */
- for (nbfd = abfd->nested_archives; nbfd; nbfd = next)
- {
- next = nbfd->archive_next;
- bfd_close (nbfd);
- }
-
if (! BFD_SEND (abfd, _close_and_cleanup, (abfd)))
return FALSE;
crc = ~crc & 0xffffffff;
for (end = buf + len; buf < end; ++ buf)
crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8);
- return ~crc & 0xffffffff;;
+ return ~crc & 0xffffffff;
}