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: Add SHF_GNU_COMPRESSED


On Mon, Jul 19, 2010 at 5:03 PM, Cary Coutant <ccoutant@google.com> wrote:
>> I am having a second though. I am leaning toward SHF_GNU_COMPRESSED
>> instead of SHT_GNU_COMPRESSED_BITS since compressed sections are
>> still SHT_PROGBITS. ?We don't have to worry about the older tools since
>> they can't process compressed section anyway. The difference is with
>> SHF_GNU_COMPRESSED, the older tools may find garbage in compressed
>> debug sections, instead of ignore them. ?But it will make binutils much much
>> nicer. ?We can compress/decompress debug sections without changing
>> section names.
>>
>> Cary, what do you think?
>
> The reason I prefer to use a section type (SHT_...) rather than a flag
> (SHF_...) is that it feels like it's neither a PROGBITS section nor a
> NOBITS section -- it's something else. With a new flag, unaware tools
> will ignore the flag and just treat the section as an ordinary
> PROGBITS section, which is unlikely to work. With a new section type,
> they're more likely to complain rather than process the section wrong.
>

That is true. On the other hand, I got a very pleasant surprise with gdb
since it checks the "ZLIB" signature, not section name. It works just
fine with SHF_GNU_COMPRESSED.  With older gdb, I got

This GDB was configured as "x86_64-redhat-linux-gnu"...Dwarf Error:
wrong version in compilation unit header (is 0, should be 2) [in
module /export/home/hjl/bugs/binutils/compresss-2/readelf.gz]
Using host libthread_db library "/lib64/libthread_db.so.1".

(gdb) b main
No symbol table is loaded.  Use the "file" command.
(gdb)

SHF_GNU_COMPRESSED is more flexible and works with any SHT_*.
Besides, we have "objcopy --decompress-debug-sections".


-- 
H.J.


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