On Tue, Oct 15, 2024 at 4:50 AM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:
The objtool program needs to analysis the control flow of each
object file generated by compiler toolchain, it needs to know
all the locations that a branch instruction may jump into.
+ arch_prepare_goto();
goto *jumptable[insn->code];
That looks fragile. There is no guarantee that compiler will keep
asm statement next to indirect goto.
It has all rights to move/copy such goto around.
There are other parts in the kernel which are not annotated either:
drm_exec_retry_on_contention(),
drivers/misc/lkdtm/cfi.c
You're arguing that it's hard to properly in the compiler,
but that's the only option. It has to be done by the compiler.