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]

Add SHF_GNU_COMPRESSED


On Fri, Jul 16, 2010 at 4:15 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hi Cary,
>
> I updated the branch. Reading compress debug sections should work now.
>
> On Fri, Jul 16, 2010 at 3:19 PM, Cary Coutant <ccoutant@google.com> wrote:
>>>> I was thinking the right way to do this would probably be to keep the
>>>> section name unchanged, but change the section type from SHT_PROGBITS
>>>> to SHT_GNU_COMPRESSED_BITS.
>>>
>>> Doing this may trigger more changes. In theory, ?no one should
>>> depend on section name. You can get the original section name
>>> by checking the new decompressed bit.
>>
>> Sorry, I didn't finish the thought, and I don't think it was clear
>> what I meant. I meant that, if I were doing this from scratch, instead
>> of naming the compressed sections ".zdebug_info", etc., I'd have kept
>> the names unchanged, but changed the section type from SHT_PROGBITS to
>> SHT_GNU_COMPRESSED_BITS in the ELF section table, and readers would
>> have known that decompression was necessary based on the section type
>> instead of the section name (agreeing with your assertion that no one
>> should depend on the section name). I'd have changed gas to output the
>> new section type when compressing, and changed bfd and gold to
>> decompress any SHT_GNU_COMPRESSED_BITS section.
>
> That sounds better if we don't have to worry about the older tools.
>
>> I think that would have been more elegant, but it would have probably
>> been a more difficult transition, as older tools would not have
>> gracefully ignored the compressed sections.
>>
>
> That is true.
>

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?


-- 
H.J.


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