public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Cary Coutant <ccoutant@google.com>, binutils@sourceware.org
Subject: Re: PATCH: PR gas/12409: --compress-debug-sections doesn't work on empty DWARF sections
Date: Wed, 19 Jan 2011 00:09:00 -0000	[thread overview]
Message-ID: <20110119000850.GZ11694@bubble.grove.modra.org> (raw)
In-Reply-To: <AANLkTinBE=3WGoUSPVk4EXZB+MS5nvqaHvcOePuviGJv@mail.gmail.com>

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

  parent reply	other threads:[~2011-01-19  0:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-18 18:57 H.J. Lu
2011-01-18 23:54 ` H.J. Lu
2011-01-19  0:00   ` Cary Coutant
2011-01-19  0:09   ` Alan Modra [this message]
2011-01-19  0:13     ` H.J. Lu
2011-01-19  0:22       ` H.J. Lu
2011-02-10  5:06 ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110119000850.GZ11694@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=ccoutant@google.com \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).