Red Hat Bugzilla – Bug 881369
Dwarf Compression breaks .gnu_debuglink crc32 reference
Last modified: 2012-11-29 02:31:13 EST
Description of problem:
Whenever we create a separate debug info file we record a reference
to the separate debug info file in a .gnu_debuglink section in the
original binary. This contains the filename of the debug file and the
crc32 checksum (so that we can ensure it matches the real file and not
some other version). (Additionally we record a build id in the main
binary and allow lookup of debuginfo via that, but some things like
oprofile still rely on the old crc32 version).
With the addition of the new dwarf compression we (optionally) run a
debug info compression utility on the separate debuginfo files (as
part of the /usr/lib/rpm/find-debuginfo.sh script). This makes them a
lot smaller and thus gives smaller debuginfo packages.
However, this also modifies the separate debug info files giving them
different crc32 checksums than what was originally stored in the main
binary in the .gnu_debuglink section. This means that separate
debuginfo lookup via this is broken. After compressing the debug info
we need to update the crc32 value in the main binary to the the new
If we take a sample binary to peek at, like ls, we can obtain what the stripped binary thinks is the crc32.
# readelf -x .gnu_debuglink /usr/bin/ls
Hex dump of section '.gnu_debuglink':
0x00000000 6c732e64 65627567 00000000 a9a5c382 ls.debug........
Then if we look at the debuginfo file, it doesn't match.
# crc32 /usr/lib/debug/usr/bin/ls.debug
Also note, there is a separate bug filed for openprofile. The current thinking there is to resolve debuginfo by build-id like gdb. But the crc method needs to be fixed as it is a fallback for things like gdb as well.
Reassigning to dwarf compression feature owner.
There is nothing that can be done about that, the compressor has access just to the separate debug file, not the original file, thus it can't modify the corresponding .gnu_debuglink section. But it is not a big deal, just ignore the crc32 and use build-id. Doing crc32 of the whole debug file is extremely slow anyway.