This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Add --compress-debug-sections option to gas


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]