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: PR gas/12409: --compress-debug-sections doesn't work on empty DWARF sections


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


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