<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-rng/tools/objtool, branch master</title>
<subtitle>Development tree for the kernel CSPRNG</subtitle>
<id>https://git.zx2c4.com/linux-rng/atom/tools/objtool?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-rng/atom/tools/objtool?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/'/>
<updated>2025-12-01T09:42:27Z</updated>
<entry>
<title>objtool: Fix segfault on unknown alternatives</title>
<updated>2025-12-01T09:42:27Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@kernel.org</email>
</author>
<published>2025-12-01T09:42:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=6ec33db1aaf06a76fb063610e668f8e12f32ebbf'/>
<id>urn:sha1:6ec33db1aaf06a76fb063610e668f8e12f32ebbf</id>
<content type='text'>
So 'objtool --link -d vmlinux.o' gets surprised by this endbr64+endbr64 pattern
in ___bpf_prog_run():

	___bpf_prog_run:
	1e7680:  ___bpf_prog_run+0x0                                                     push   %r12
	1e7682:  ___bpf_prog_run+0x2                                                     mov    %rdi,%r12
	1e7685:  ___bpf_prog_run+0x5                                                     push   %rbp
	1e7686:  ___bpf_prog_run+0x6                                                     xor    %ebp,%ebp
	1e7688:  ___bpf_prog_run+0x8                                                     push   %rbx
	1e7689:  ___bpf_prog_run+0x9                                                     mov    %rsi,%rbx
	1e768c:  ___bpf_prog_run+0xc                                                     movzbl (%rbx),%esi
	1e768f:  ___bpf_prog_run+0xf                                                     movzbl %sil,%edx
	1e7693:  ___bpf_prog_run+0x13                                                    mov    %esi,%eax
	1e7695:  ___bpf_prog_run+0x15                                                    mov    0x0(,%rdx,8),%rdx
	1e769d:  ___bpf_prog_run+0x1d                                                    jmp    0x1e76a2 &lt;__x86_indirect_thunk_rdx&gt;
	1e76a2:  ___bpf_prog_run+0x22                                                    endbr64
	1e76a6:  ___bpf_prog_run+0x26                                                    endbr64
	1e76aa:  ___bpf_prog_run+0x2a                                                    mov    0x4(%rbx),%edx

And crashes due to blindly dereferencing alt-&gt;insn-&gt;alt_group.

Bail out on NULL -&gt;alt_group, which produces this warning and continues
with the disassembly, instead of a segfault:

  .git/O/vmlinux.o: warning: objtool: &lt;alternative.1e769d&gt;: failed to disassemble alternative

Cc: Alexandre Chartre &lt;alexandre.chartre@oracle.com&gt;
Cc: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>objtool: Build with disassembly can fail when including bdf.h</title>
<updated>2025-11-27T08:32:46Z</updated>
<author>
<name>Alexandre Chartre</name>
<email>alexandre.chartre@oracle.com</email>
</author>
<published>2025-11-26T13:45:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=59bfa6408214b6533d8691715cf5459e89b45b89'/>
<id>urn:sha1:59bfa6408214b6533d8691715cf5459e89b45b89</id>
<content type='text'>
Building objtool with disassembly support can fail when including
the bdf.h file:

  In file included from tools/objtool/include/objtool/arch.h:108,
                   from check.c:14:
  /usr/include/bfd.h:35:2: error: #error config.h must be included before this header
     35 | #error config.h must be included before this header
        |  ^~~~~

This check is present in the bfd.h file generated from the binutils
source code, but it is not necessarily present in the bfd.h file
provided in a binutil package (for example, it is not present in
the binutil RPM).

The solution to this issue is to define the PACKAGE macro before
including bfd.h. This is the solution suggested by the binutil
developer in bug 14243, and it is used by other kernel tools
which also use bfd.h (perf and bpf).

Fixes: 59953303827ec ("objtool: Disassemble code with libopcodes instead of running objdump")
Closes: https://lore.kernel.org/all/3fa261fd-3b46-4cbe-b48d-7503aabc96cb@oracle.com/
Reported-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Suggested-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Signed-off-by: Alexandre Chartre &lt;alexandre.chartre@oracle.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://sourceware.org/bugzilla/show_bug.cgi?id=14243
Link: https://patch.msgid.link/20251126134519.1760889-1-alexandre.chartre@oracle.com
</content>
</entry>
<entry>
<title>objtool: Trim trailing NOPs in alternative</title>
<updated>2025-11-24T19:40:48Z</updated>
<author>
<name>Alexandre Chartre</name>
<email>alexandre.chartre@oracle.com</email>
</author>
<published>2025-11-21T09:53:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=c0a67900dc129825c48d3638480297aa00f39c00'/>
<id>urn:sha1:c0a67900dc129825c48d3638480297aa00f39c00</id>
<content type='text'>
When disassembling alternatives replace trailing NOPs with a single
indication of the number of bytes covered with NOPs.

Signed-off-by: Alexandre Chartre &lt;alexandre.chartre@oracle.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Link: https://patch.msgid.link/20251121095340.464045-31-alexandre.chartre@oracle.com
</content>
</entry>
<entry>
<title>objtool: Add wide output for disassembly</title>
<updated>2025-11-24T19:40:48Z</updated>
<author>
<name>Alexandre Chartre</name>
<email>alexandre.chartre@oracle.com</email>
</author>
<published>2025-11-21T09:53:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=aff95e0d4e277c53fa274f4a5b6854849f3fc84d'/>
<id>urn:sha1:aff95e0d4e277c53fa274f4a5b6854849f3fc84d</id>
<content type='text'>
Add the --wide option to provide a wide output when disassembling.
With this option, the disassembly of alternatives is displayed
side-by-side instead of one above the other.

Signed-off-by: Alexandre Chartre &lt;alexandre.chartre@oracle.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Link: https://patch.msgid.link/20251121095340.464045-30-alexandre.chartre@oracle.com
</content>
</entry>
<entry>
<title>objtool: Compact output for alternatives with one instruction</title>
<updated>2025-11-24T19:40:48Z</updated>
<author>
<name>Alexandre Chartre</name>
<email>alexandre.chartre@oracle.com</email>
</author>
<published>2025-11-21T09:53:38Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=07d70b271a6fc4f546b153081f3685931561be7b'/>
<id>urn:sha1:07d70b271a6fc4f546b153081f3685931561be7b</id>
<content type='text'>
When disassembling, if an instruction has alternatives which are all
made of a single instruction then print each alternative on a single
line (instruction + description) so that the output is more compact.

Signed-off-by: Alexandre Chartre &lt;alexandre.chartre@oracle.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Link: https://patch.msgid.link/20251121095340.464045-29-alexandre.chartre@oracle.com
</content>
</entry>
<entry>
<title>objtool: Improve naming of group alternatives</title>
<updated>2025-11-24T19:40:48Z</updated>
<author>
<name>Alexandre Chartre</name>
<email>alexandre.chartre@oracle.com</email>
</author>
<published>2025-11-21T09:53:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=56967b9a772298ad276858ddab5a655b1d167623'/>
<id>urn:sha1:56967b9a772298ad276858ddab5a655b1d167623</id>
<content type='text'>
Improve the naming of group alternatives by showing the feature name and
flags used by the alternative.

Signed-off-by: Alexandre Chartre &lt;alexandre.chartre@oracle.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Link: https://patch.msgid.link/20251121095340.464045-28-alexandre.chartre@oracle.com
</content>
</entry>
<entry>
<title>objtool: Add Function to get the name of a CPU feature</title>
<updated>2025-11-24T19:39:47Z</updated>
<author>
<name>Alexandre Chartre</name>
<email>alexandre.chartre@oracle.com</email>
</author>
<published>2025-11-21T09:53:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=8308fd001927f5bdc37a9c9f9c413baec3fb7bbe'/>
<id>urn:sha1:8308fd001927f5bdc37a9c9f9c413baec3fb7bbe</id>
<content type='text'>
Add a function to get the name of a CPU feature. The function is
architecture dependent and currently only implemented for x86. The
feature names are automatically generated from the cpufeatures.h
include file.

Signed-off-by: Alexandre Chartre &lt;alexandre.chartre@oracle.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Link: https://patch.msgid.link/20251121095340.464045-27-alexandre.chartre@oracle.com
</content>
</entry>
<entry>
<title>objtool: Provide access to feature and flags of group alternatives</title>
<updated>2025-11-21T14:30:14Z</updated>
<author>
<name>Alexandre Chartre</name>
<email>alexandre.chartre@oracle.com</email>
</author>
<published>2025-11-21T09:53:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=be5ee60ac554c6189cda963e886c4b97d2cb978c'/>
<id>urn:sha1:be5ee60ac554c6189cda963e886c4b97d2cb978c</id>
<content type='text'>
Each alternative of a group alternative depends on a specific
feature and flags. Provide access to the feature/flags for each
alternative as an attribute (feature) in struct alt_group.

Signed-off-by: Alexandre Chartre &lt;alexandre.chartre@oracle.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Link: https://patch.msgid.link/20251121095340.464045-26-alexandre.chartre@oracle.com
</content>
</entry>
<entry>
<title>objtool: Fix address references in alternatives</title>
<updated>2025-11-21T14:30:14Z</updated>
<author>
<name>Alexandre Chartre</name>
<email>alexandre.chartre@oracle.com</email>
</author>
<published>2025-11-21T09:53:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=4aae0d3f77b1104e55847870d15c3749ca575fcf'/>
<id>urn:sha1:4aae0d3f77b1104e55847870d15c3749ca575fcf</id>
<content type='text'>
When using the --disas option, alternatives are disassembled but
address references in non-default alternatives can be incorrect.

The problem is that alternatives are shown as if they were replacing the
original code of the alternative. So if an alternative is referencing
an address inside the alternative then the reference has to be
adjusted to the location of the original code.

Signed-off-by: Alexandre Chartre &lt;alexandre.chartre@oracle.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Link: https://patch.msgid.link/20251121095340.464045-25-alexandre.chartre@oracle.com
</content>
</entry>
<entry>
<title>objtool: Disassemble jump table alternatives</title>
<updated>2025-11-21T14:30:14Z</updated>
<author>
<name>Alexandre Chartre</name>
<email>alexandre.chartre@oracle.com</email>
</author>
<published>2025-11-21T09:53:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=7e017720aae87dc2ca2471ac295e34e2b240e5f5'/>
<id>urn:sha1:7e017720aae87dc2ca2471ac295e34e2b240e5f5</id>
<content type='text'>
When using the --disas option, also disassemble jump tables.

Signed-off-by: Alexandre Chartre &lt;alexandre.chartre@oracle.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Link: https://patch.msgid.link/20251121095340.464045-24-alexandre.chartre@oracle.com
</content>
</entry>
</feed>
