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: Only compress debug sections if this saves space


Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> The Solaris toolchain currently gains support for compressed debug
> sections, both for the current GNU format and the new format already
> approved for the ELF gABI.  While working on gcc support starting at
>
> 	http://gcc.gnu.org/ml/gcc-patches/2013-04/msg00679.html
>
> I noticed elfdump complaining about some of the object files with
> compressed debug sections, e.g. the gas testcase:
>
> % elfdump -c  dw2-compress-1.o
> [...]
> Section Header[6]:  sh_name: .zdebug_abbrev
>     sh_addr:      0               sh_flags:   0
>     sh_size:      0x46            sh_type:    [ SHT_PROGBITS ]
>     sh_offset:    0x8b            sh_entsize: 0
>     sh_link:      0               sh_info:    0
>     sh_addralign: 0x1       
>     ch_size:      0x33            ch_type:    ZLIB (GNU format)
> dw2-compress-1.o.orig: .zdebug_abbrev: compressed section is larger than original: size 0x46: uncompressed size 0x33
> [...]
>
> 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.
>
> Given that the testcase is from the gdb testsuite, that should be
> adapted as well, but will need to account for both compressed and
> uncompressed debug sections.
>
> Ok for mainline?
>
> Thanks.
> 	Rainer
>
>
> 2013-05-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
> 	gas:
> 	* write.c (compress_debug): Only compress if it saves space.
>
> 	gas/testsuite:
> 	* gas/i386/dw2-compress-1.d: .debug_info and .debug_abbrev aren't
> 	compressed.

This patch has now remained unreviewed for a week.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


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