]> code.ossystems Code Review - openembedded-core.git/commit
package.bbclass: inject "minidebuginfo" into packaged binaries
authorDan Callaghan <dan.callaghan@opengear.com>
Sun, 19 Apr 2020 08:16:03 +0000 (18:16 +1000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 26 Apr 2020 12:58:45 +0000 (13:58 +0100)
commit4df992ce50c2d12e356b6d9fe7b23a6320c8b4df
tree16aed7b00e8502db421ffe37e69b81a43b82c543
parent7b3cdc74773fce29ef4fec4f60b719f46c3e7f30
package.bbclass: inject "minidebuginfo" into packaged binaries

"Mini debuginfo" is a special section in ELF executables containing
minimal compressed debuginfo for non-exported symbols:

https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html

It lets debugging tools produce better stack traces, including local
function names, without incurring the space overhead of full debuginfo.
The feature was originally developed for Fedora:

https://fedoraproject.org/wiki/Features/MiniDebugInfo

but nowadays it is widely supported in the ecosystem, including in gdb
and elfutils (and therefore also in tools which use elfutils, such as
systemd-coredump).

This patch adds an optional extra step in package.bbclass to inject
minidebuginfo while stripping and splitting out debuginfo. It can be
enabled by setting PACKAGE_MINIDEBUGINFO=1. In my testing, this
increases the size of resulting binaries by roughly 5%.

The code for producing and re-injecting the minidebuginfo is my own
Python implementation but corresponds directly to the shell
implementation that RPM uses for doing the same:

https://github.com/rpm-software-management/rpm/blob/rpm-4.15.1-release/scripts/find-debuginfo.sh#L261

Signed-off-by: Dan Callaghan <dan.callaghan@opengear.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/package.bbclass