PATCH: PR gas/12409: --compress-debug-sections doesn't work on empty DWARF sections

Alan Modra amodra@gmail.com
Wed Jan 19 00:09:00 GMT 2011


On Tue, Jan 18, 2011 at 03:54:32PM -0800, H.J. Lu wrote:
> Should I apply this patch? Since the compression header is 12 byte,
> if the section is smaller than 12 bytes, compressed section will be
> bigger.

OK.  Perhaps a larger value would be even better?

> diff --git a/gas/write.c b/gas/write.c
> index aabb96d..9e4d6f4 100644
> --- a/gas/write.c
> +++ b/gas/write.c
> @@ -1359,7 +1359,7 @@ compress_debug (bfd *abfd, asection *sec, void *xxx ATTRIB
> UTE_UNUSED)
>    flagword flags = bfd_get_section_flags (abfd, sec);
> 
>    if (seginfo == NULL
> -      || sec->size == 0
> +      || sec->size < 12
>        || (flags & (SEC_ALLOC | SEC_HAS_CONTENTS)) == SEC_ALLOC)
>      return;

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list