This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH 1/4] default_debugscn_p: Add support for compressed debug section.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Mon, 13 Aug 2012 21:01:53 +0200
- Subject: Re: [PATCH 1/4] default_debugscn_p: Add support for compressed debug section.
On Mon, Aug 13, 2012 at 06:22:29PM +0200, Kurt Roeckx wrote:
> On Mon, Aug 13, 2012 at 01:36:10PM +0200, Mark Wielaard wrote:
> > On Sun, Aug 12, 2012 at 06:28:59PM +0200, Kurt Roeckx wrote:
> > > @@ -657,7 +657,13 @@ default_debugscn_p (const char *name)
> > > const size_t ndwarf_scn_names = (sizeof (dwarf_scn_names)
> > > / sizeof (dwarf_scn_names[0]));
> > > for (size_t cnt = 0; cnt < ndwarf_scn_names; ++cnt)
> > > - if (strcmp (name, dwarf_scn_names[cnt]) == 0)
> > > + if (strcmp (name, dwarf_scn_names[cnt]) == 0
> > > +#if USE_ZLIB
> > > + || (name[0] == '.' && name[1] == 'z'
> > > + && dwarf_scn_names[cnt][1] == 'd'
> > > + && strcmp (&name[2], &dwarf_scn_names[cnt][1]) == 0)
> > > +#endif
> >
> > I don't think it is necessary to depend on USE_ZLIB here, we are
> > just checking the name, not the content anyway.
>
> I did that based on the same #if in readelf.c
aha, I missed that, sorry.
But this comes back to my comment on the other patch.
In the case of readelf.c this makes sense, since it uses libdwfl
to access the elf data it can "transparently" read the compressed
data. But other callers might not be able to process compressed
sections. So I think we should carefully audit all callers to
make sure that if debugscn_p () returns true for a compressed
section then they are actually able to process the data.
Thanks,
Mark