[OE-core] [PATCH v3] elfutils: add PACKAGECONFIG for compression algorithms

Dan Callaghan dan.callaghan at opengear.com
Tue Oct 29 21:46:03 UTC 2019


Excerpts from Adrian Bunk's message of 2019-10-29 22:18:21 +02:00:
> On Wed, Oct 16, 2019 at 08:44:56AM +1000, Dan Callaghan wrote:
> > Elfutils has optional support for bzip2 and xz (lzma). It uses
> > this for decompressing embedded ELF sections like the .gnu_debugdata
> > section for "mini debuginfo":
> >
> > https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html
> >...
> > +PACKAGECONFIG ??= "bzip2"
> > +PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}"
> > +PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"
> >...
> 
> Is any tooling actually doing this compression by default?
> 
> It is a bit surprising that this has the mostly-obsolete bzip2 enabled
> by default but not the more common (and better compressing) xz.

I couldn't find anything that would ever use the bzip2 decompression in 
elfutils, so I had a quick look at why they even added bzip2 support in 
the first place. It turns out it was for reading compressed kernel 
images (presumably, in the elfutils tools like eu-readelf):

https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=d6ccdc1a05f27bf0bb5d802ec14f879aa9fe3e98

    commit d6ccdc1a05f27bf0bb5d802ec14f879aa9fe3e98
    Author: Roland McGrath <roland at redhat.com>
    Date:   Wed Aug 26 00:23:01 2009 -0700

        libdwfl: Support Linux bzip2 kernel images for automatic decompression.

And indeed on my Fedora host eu-readelf can decode ELF information from 
a kernel bzImage, but the eu-readelf built by Yocto's elfutils-native 
recipe says "not a valid ELF file" when I feed it the same bzImage.

Whether that's useful or not is a different question. In our product 
I am planning to disable bzip2 (because we don't use the elfutils tools 
for anything) and enable xz (for .gnu_debugdata sections).

-- 
Dan Callaghan <dan.callaghan at opengear.com>
Software Engineer
Opengear <https://opengear.com/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20191030/a341dde6/attachment.sig>


More information about the Openembedded-core mailing list