aboutsummaryrefslogtreecommitdiff
path: root/bfd/archive.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2010-11-12 22:10:18 +0000
committerH.J. Lu <hjl.tools@gmail.com>2010-11-12 22:10:18 +0000
commite326bf5f36a655709f6089ee1b68e623ea7db607 (patch)
treefc4cd8c435ddfcd50ff217b01129c74ebc0ec050 /bfd/archive.c
parent74af9197f1e4e5a347c29ff54e08e170b9334826 (diff)
downloadgdb-e326bf5f36a655709f6089ee1b68e623ea7db607.zip
gdb-e326bf5f36a655709f6089ee1b68e623ea7db607.tar.gz
gdb-e326bf5f36a655709f6089ee1b68e623ea7db607.tar.bz2
Properly copy BFD_COMPRESS and BFD_DECOMPRESS to archive element.
2010-11-12 H.J. Lu <hongjiu.lu@intel.com> * archive.c (_bfd_get_elt_at_filepos): Copy BFD_COMPRESS and BFD_DECOMPRESS. (bfd_openr_next_archived_file): Revert the last change.
Diffstat (limited to 'bfd/archive.c')
-rw-r--r--bfd/archive.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/bfd/archive.c b/bfd/archive.c
index ed40141..258c8d9 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -655,6 +655,9 @@ _bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos)
n_nfd->arelt_data = new_areldata;
+ /* Copy BFD_COMPRESS and BFD_DECOMPRESS flags. */
+ n_nfd->flags |= archive->flags & (BFD_COMPRESS | BFD_DECOMPRESS);
+
if (_bfd_add_bfd_to_archive_cache (archive, filepos, n_nfd))
return n_nfd;
@@ -697,8 +700,6 @@ DESCRIPTION
bfd *
bfd_openr_next_archived_file (bfd *archive, bfd *last_file)
{
- bfd *abfd;
-
if ((bfd_get_format (archive) != bfd_archive)
|| (archive->direction == write_direction))
{
@@ -706,14 +707,8 @@ bfd_openr_next_archived_file (bfd *archive, bfd *last_file)
return NULL;
}
- abfd = BFD_SEND (archive,
+ return BFD_SEND (archive,
openr_next_archived_file, (archive, last_file));
-
- /* Copy BFD_COMPRESS and BFD_DECOMPRESS flags. */
- if (abfd)
- abfd->flags |= archive->flags & (BFD_COMPRESS | BFD_DECOMPRESS);
-
- return abfd;
}
bfd *