On 09/09/2026 05:24, ThiƩbaud Weksteen wrote:
> When generating a light skeleton, gen_trace() unconditionally sets
> skel->ctx.sz using (char *)&skel->links - (char *)skel. However, if a
> BPF object has no programs and no struct_ops maps (prog_cnt +
> attach_map_cnt == 0), do_skeleton() omits the links struct, causing the
> generated skeleton header to fail compilation.
> 
> Compute skel->ctx.sz from the end of progs (if prog_cnt > 0), maps (if
> map_cnt > 0), or ctx instead of relying on skel->links. Also remove the
> unused opts.data_sz argument passed to codegen().
> 
> Fixes: d510296d331a ("bpftool: Use syscall/loader program in "prog load" and 
> "gen skeleton" command.")
> Signed-off-by: ThiĆ©baud Weksteen <[email protected]>


Acked-by: Quentin Monnet <[email protected]>

Thank you

Reply via email to