Project:Toolchain/Binutils 2.32 upgrade notes/elfutils 0.175: unable to initialize decompress status for section .debug info

From Gentoo Wiki
Jump to:navigation Jump to:search

The problem

If you get the link failures similar to the following this article is for you:

*ld: fs/xfs/xfs_trace.o: unable to initialize decompress status for section .debug_info
*ld: fs/xfs/xfs_trace.o: unable to initialize decompress status for section .debug_info
*ld: built-in.a: member fs/xfs/xfs_trace.o in archive is not an object
*make: *** [Makefile:1020: vmlinux] Error 1
...
objdump: kernel/cgroup/.tmp_cgroup-v1.o: unable to initialize decompress status for section .debug_info
objdump: kernel/cgroup/.tmp_cgroup-v1.o: unable to initialize decompress status for section .debug_info
objdump: kernel/cgroup/.tmp_cgroup-v1.o: file format not recognized

Or if your gdb session fails as:

user $ gdb /usr/bin/python3.6
user $ (gdb) r
Starting program: /usr/bin/python3.6
process 40757 is executing new program: /usr/bin/python3.6m
BFD: /usr/lib64/debug/usr/bin/python3.6m.debug: unable to initialize decompress status for section .debug_aranges
BFD: /usr/lib64/debug/usr/bin/python3.6m.debug: unable to initialize decompress status for section .debug_aranges
...

The solution

This is a result of new dev-libs/elfutils being used against old binutils (or old gdb).

To fix it you need to switch active binutils to sys-devel/binutils-2.32 (and to >=gdb-8.3) or above and rebuild the affected packages.

root #binutils-config -l
[1] x86_64-pc-linux-gnu-2.31.1 *
[2] x86_64-pc-linux-gnu-2.32
root #binutils-config x86_64-pc-linux-gnu-2.32
root #binutils-config -l
[1] x86_64-pc-linux-gnu-2.31.1
[2] x86_64-pc-linux-gnu-2.32 *

The details

Starting from dev-libs/elfutils-0.175 libelf writes compressed section alignment according to the ELF spec (see https://sourceware.org/PR23916). Unfortunately GNU assembler (gas from binutis-2.31.1 and older) writes non-conformant alignment. This means that libelf processing of such ELF files "corrupts" object files for binutils-2.31.

binutils-2.32 now writes conformant ELF alignments (see https://sourceware.org/PR23919) but the result is not compatible to binutils-2.31.

The only affected sections are compressed debug sections. If you want to repair existing object files built with FEATURES=compressdebug it should be enough to strip files on disk.