This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fwd: PATCH: Extend .zdebug section support to binutils and ld
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Cary Coutant <ccoutant at google dot com>, Binutils <binutils at sourceware dot org>, Alan Modra <amodra at gmail dot com>
- Date: Fri, 12 Nov 2010 14:14:27 -0800
- Subject: Re: Fwd: PATCH: Extend .zdebug section support to binutils and ld
- References: <20100722165443.GA26398@intel.com> <20100722170606.GA26393@caradoc.them.org> <AANLkTilUitNfK04ybRdsUIyN7nTKHOtUG2cQ36UwDmXM@mail.gmail.com> <20100722195924.GA4912@caradoc.them.org> <AANLkTimBZs4t=QDKcvzfsAFg2CnSUjSUXw+Eqz2nyA+m@mail.gmail.com> <AANLkTi=gL5SysVBSdhcDsM5JFLr4SGTSaT3-9YsSFghu@mail.gmail.com> <AANLkTimy34mCiihdJJ-dsOyWvuh_kaQr8SmTmv=XDZiU@mail.gmail.com> <4CC98DA4.7060804@redhat.com>
On Thu, Oct 28, 2010 at 7:50 AM, Nick Clifton <nickc@redhat.com> wrote:
> Hi Cary,
>
>> Ping? I'd like to see binutils and gnu ld supporting compressed debug
>> sections.
>
> Well I have no objections to the patch, so unless Alan or Daniel have
> anything to say then please consider it approved.
>
I checked in this following patch to properly copy BFD_COMPRESS and
BFD_DECOMPRESS to archive element.
--
H.J.
----
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index aab75e9..35aae25 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2010-11-11 Mingming Sun <mingm.sun@gmail.com>
* archures.c (bfd_mach_mips_loongson_3a): Defined.
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 *