This is the mail archive of the
mailing list for the binutils project.
Re: Only compress debug sections if this saves space
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 13 May 2013 14:14:01 +0200
- Subject: Re: Only compress debug sections if this saves space
- References: <ydd1u9f9cnv dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <CAHACq4pKgfHZ17oWDns58JxEPS9i-ziGJaPRZQYydtj6wH8fcA at mail dot gmail dot com>
Cary Coutant <firstname.lastname@example.org> writes:
>> The warning is correct and easy to fix, as shown by the following
>> patch. In the testcase above, only one out of three debug sections
>> shrinks when compressing. I've chosen to adapt the .d file to account
>> for this and didn't try to create a larger testcase where all debug
>> sections do compress.
> My original rationale for always compressing was that (a) the
> compressed section would be larger than the uncompressed only for
> trivially-small sections to begin with, so the net savings of
> bothering to check is minimal; and (b) it makes testing more
> difficult, as a random unrelated change might cause the section to
> fall under the threshold and suddenly it's not compressed (as you've
> already noticed).
> HJ made a change so that it would only compress the section if it was
> larger than the size of the compression header, but I believe he made
> a deliberate decision not to make it conditional on the final size for
> the above reasons.
> I'm not really opposed to this change -- I just want to consider the
> cost (it makes testing more fragile) vs. the benefit (which seems
> fairly minimal). If you go ahead, I'd argue that you probably should
> try to make the testcase large enough so that all the debug sections
While the savings aren't big, it seems strange that compression would
actually enlarge things. As for the testing complexity, even in gdb
which would have to deal with gas versions without and with the change,
the actuall testcase update consists of two characters (.zdebug ->
.z?debug in two places). It is a little more fragile than always
compressing, but after all the feature's goal isn't ease of testing.
I'm undecided how best to handle the testcase, though: I could either
enlarge the testcase (which is just a copy of the gdb one) to always
have space savings with compression, or leave the existing one as is
(with some sections compressing, others not) and add a second one where
all .debug sections do compress.
Any other opinions, approvals, rejections of the patch?
Rainer Orth, Center for Biotechnology, Bielefeld University