This is the mail archive of the
mailing list for the binutils project.
Re: [patch] sanity check bfd_is_section_compressed header
- From: Cary Coutant <ccoutant at google dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 5 Jun 2013 23:25:34 -0700
- Subject: Re: [patch] sanity check bfd_is_section_compressed header
- References: <201306051918 dot r55JIjb5003882 at greed dot delorie dot com> <CAHACq4r=h-5MG_XrK6_y=TmhZGgaMENCVnZHFVzq74qhVLbyPQ at mail dot gmail dot com> <201306052356 dot r55Nur9Q010748 at greed dot delorie dot com>
>> Hmmm, the linker shouldn't even be looking for "ZLIB" unless the
>> section name is ".zdebug_str" (or, for the new gABI feature, unless
>> the SHF_COMPRESSED flag is set). Wouldn't that be a better check?
> I see no reference to SHF_COMPRESSED in the bfd sources, so I can't
> check for it.
Yeah, I don't think it's officially in the gABI yet, but it's on the way.
> It seems intentional that it supports both .debug and .zdebug:
> 2010-10-29 H.J. Lu <firstname.lastname@example.org>
> Cary Coutant <email@example.com>
> * elf.c (_bfd_elf_make_section_from_shdr): Call
> bfd_is_section_compressed to check if a DWARF debug section is
> compressed. Call bfd_init_section_compress_status or
> bfd_init_section_decompress_status if needed.
> /* Compress/decompress DWARF debug sections with names: .debug_* and
> .zdebug_*, after the section flags is set. */
> if ((flags & SEC_DEBUGGING)
> && ((name == 'd' && name == '_')
> || (name == 'z' && name == '_')))
Heh. I guess it's my fault, then, but I think it's clearly wrong to
try to decompress a .debug_* section, especially given that its
contents might legitimately begin with the magic string "ZLIB". I
think we were just trying to be tolerant there.