]> git.baikalelectronics.ru Git - kernel.git/commit
bpf/libbpf: BTF support for typed ksyms
authorHao Luo <haoluo@google.com>
Tue, 29 Sep 2020 23:50:45 +0000 (16:50 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 2 Oct 2020 21:59:25 +0000 (14:59 -0700)
commit2d73c968211cfa01da323855866b151296084df8
treed4a0fd5035fb2c95af17be35073c99958913cd49
parent1b3382b4757825327e9b83f81432755b080405f3
bpf/libbpf: BTF support for typed ksyms

If a ksym is defined with a type, libbpf will try to find the ksym's btf
information from kernel btf. If a valid btf entry for the ksym is found,
libbpf can pass in the found btf id to the verifier, which validates the
ksym's type and value.

Typeless ksyms (i.e. those defined as 'void') will not have such btf_id,
but it has the symbol's address (read from kallsyms) and its value is
treated as a raw pointer.

Signed-off-by: Hao Luo <haoluo@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200929235049.2533242-3-haoluo@google.com
tools/lib/bpf/libbpf.c