]> 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)
commit7548a7541b2cd5de2e04e99bfe6bf04e59adf0de
treed4a0fd5035fb2c95af17be35073c99958913cd49
parent8cfdf0b426e593689ad80eec9a572108147895b0
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