Re: [PATCH bpf-next v2 4/6] libbpf: Resolve typeless ksyms via KALLSYMS_QUERY ioctl

From: Samuel Wu

Date: Tue Oct 27 2026 - 17:47:06 EST


On Thu, Oct 22, 2026 at 5:51 PM <bot+bpf-ci@xxxxxxxxxx> wrote:

[...]

> Would it work to fall back to libbpf_kallsyms_parse() for typeless externs
> that are still unresolved after the ioctl pass? That only costs extra time
> when a symbol is actually missing. Alternatively, the kernel query could
> match the .llvm. suffix for data symbols. I did not find a fix for this in
> the rest of the series.

Yes, for strong externs. In v3, if a strong extern returns -ENOENT,
I'll fallback to /proc/kallsyms to scanning .llvm.<hash> suffix,
keeping the same semantics as before.

Weak misses must default to zero without falling back to a scan.
Otherwise, all objects marked __weak would pay the full /proc/kallsyms
scanning cost. This is a slight semantic change, as a weak symbol with
a ThinLTO-renamed static now resolves to zero. However, this is the
behavior of the light skeleton (gen_loader.c), so perhaps it's
acceptable. I'll note this in the v3 commit message.

[...]

> Should the fallback cover any error other than -EADDRNOTAVAIL (and other
> real lookup errors), or at least -EACCES as well, with a pr_warn() for the
> errors that are not handled?

I'll update v3 to log pr_warn() and return on open() failure or lookup
errors. And then I think I should reset partial state and fall back to
/proc/kallsyms on ENOTTY, EPERM, EACCES, and EOPNOTSUPP.