On Tue, Sep 29, 2026 at 11:21:34AM +0530, Shivang Upadhyay wrote:
From: Sathvika Vasireddy <redacted>
Objtool throws a lot of can't find starting instruction warnings
when run on vmlinux with --ftr-fixup option.
These warnings are seen because find_insn() function looks for
instructions at offsets that are relative to the start of the section.
In case of individual object files (.o), there are no can't find
starting instruction warnings seen because the actual offset
associated with an instruction is itself a relative offset since the
sections start at offset 0x0.
However, in case of vmlinux, find_insn() function fails to find
instructions at the actual offset associated with an instruction
since the sections in vmlinux do not start at offset 0x0. Due to
this, find_insn() will look for absolute offset and not the relative
offset. This is resulting in a lot of can't find starting instruction
warnings when objtool is run on vmlinux.
I'm confused; decode_instructions() iterates the section and inserts the
instructions at the exact offset it finds them at. Therefore it should
be able to find them again at that same offset, irrespective of the
actual start, no?
quoted hunk ↗ jump to hunk
+ if (func->len == 0 && is_notype_sym(func))
+ continue;
+
+ func_off = opts.ftr_fixup ?
+ func->offset - sec->sh.sh_addr : func->offset;
function offset really should not depend on opts. It should work
irrespective of any option, no?