diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2010-12-07 12:14:12 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2010-12-07 12:14:12 +0000 |
commit | 041b0b455158b5be8cc2773be84f0ea346917388 (patch) | |
tree | b45a2b79a3d0333ae36953ea6b04f6d1e02c3b29 | |
parent | da9e5bf8cc1ec7ebecdd72f8ac37a3bc35b6c80c (diff) | |
download | gdb-041b0b455158b5be8cc2773be84f0ea346917388.tar.gz |
Properly copy BFD_COMPRESS and BFD_DECOMPRESS to archive element.
2010-12-07 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.
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/archive.c | 13 |
2 files changed, 10 insertions, 9 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2a2949fc199..4257077501c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2010-12-07 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. + 2010-12-06 Mike Frysinger <vapier@gentoo.org> * Makefile.am (!INSTALL_LIBBFD/bfdinclude_HEADERS): Set to nothing. diff --git a/bfd/archive.c b/bfd/archive.c index ed4014151d1..258c8d9aaed 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 * |