Re: [PATCH v6 03/30] objtool: Disassemble code with libopcodes instead of running objdump
From: Alexandre Chartre
Date: Wed Dec 10 2025 - 02:24:59 EST
On 12/9/25 23:25, Maciej W. Rozycki wrote:
On Tue, 9 Dec 2025, Alexandre Chartre wrote:
Bisect log is attached. I see the problem with gcc 11.4.0, 13.3.0, and
14.3.0. I tried with both Ubuntu 22.04 and 24.04.
This sounds like a configuration issue depending on the binutils version; in
particular the setting of DISASM_INIT_STYLED (although that's supposed to be
automatically configured by tools/objtool/Makefile).
I only came across these patches now.
As attractive as it may seem how is this stuff supposed to fly given that
binutils internal libraries promise no stable API to out-of-tree software.
The interfaces can change anytime, just as it is with our internals.
Note that bpf (tools/bpf) is also using libbfd and libopcodes.
Wouldn't it make sense to improve objdump instead so as to provide the
features required?
Some disassembly features of objtool can certainly make sense in objdump
(like the support for disassembling alternatives).
But the primary goal was to provide a disassembly tracing option (--trace)
to help troubleshoot objtool validation failures. But this is specific to the
kernel build workflow, so this part would probably not make sense in objdump.
alex.
Also is it actually legal to link objtool and libopcodes together, given
that they are GPLv2 and GPLv3 respectively?
FWIW asking as one of the binutils contributors and port maintainers.
Maciej