This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Add --compress-debug-sections option to gas
- From: Alan Modra <amodra at gmail dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 29 Jun 2010 17:37:46 +0930
- Subject: Re: [patch] Add --compress-debug-sections option to gas
- References: <AANLkTim2Li4CdH8itmx1q-8oxxuH0EOcFjzaSsQzmKzX@mail.gmail.com>
On Mon, Jun 28, 2010 at 02:39:15PM -0700, Cary Coutant wrote:
> p.s. I'm not sure why my regenerated libbfd.h is different from the
> original -- nothing changed except for parameters to
> bfd_generic_get_relocated_section_contents() that used to be unnamed.
Someone hand edited the file. Now fixed.
> +bfd_boolean
> +bfd_compress_section_contents (bfd_byte **buffer, bfd_size_type *size)
> +{
> +#ifndef HAVE_ZLIB_H
> + /* These are just to quiet gcc. */
> + buffer = 0;
> + size = 0;
Except they don't quiet gcc-4.6. Just add ATTRIBUTE_UNUSED to the params.
> + compressed_buffer[4] = uncompressed_size >> 56;
This is going to warn and thus break the build when bfd_size_type is
32-bits, as can happen on a 32-bit host supporting 32-bit targets.
> @@ -1297,6 +1368,20 @@ write_contents (bfd *abfd ATTRIBUTE_UNUSED,
> addressT offset = 0;
> fragS *f;
>
> + if (bfd_get_section_flags (abfd, sec) & SEC_IN_MEMORY)
SEC_IN_MEMORY isn't sufficient. Other sections will be SEC_IN_MEMORY
too, eg. SHT_GROUP sections. I think your alternate approach of
twiddling the frag list is indicated.
--
Alan Modra
Australia Development Lab, IBM