aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2020-01-09 22:41:19 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2020-01-10 17:20:07 +0100
commit2d3eb67f64ec317bbfe340cfcc8325d40a6ff317 (patch)
tree5af845b22b56292a359da753e7dff4d53aa49aa6 /tools/include
parentMerge branch 'selftest-makefile-cleanup' (diff)
downloadlinux-dev-2d3eb67f64ec317bbfe340cfcc8325d40a6ff317.tar.xz
linux-dev-2d3eb67f64ec317bbfe340cfcc8325d40a6ff317.zip
libbpf: Sanitize global functions
In case the kernel doesn't support BTF_FUNC_GLOBAL sanitize BTF produced by the compiler for global functions. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20200110064124.1760511-2-ast@kernel.org
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/uapi/linux/btf.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/include/uapi/linux/btf.h b/tools/include/uapi/linux/btf.h
index 1a2898c482ee..5a667107ad2c 100644
--- a/tools/include/uapi/linux/btf.h
+++ b/tools/include/uapi/linux/btf.h
@@ -146,6 +146,12 @@ enum {
BTF_VAR_GLOBAL_EXTERN = 2,
};
+enum btf_func_linkage {
+ BTF_FUNC_STATIC = 0,
+ BTF_FUNC_GLOBAL = 1,
+ BTF_FUNC_EXTERN = 2,
+};
+
/* BTF_KIND_VAR is followed by a single "struct btf_var" to describe
* additional information related to the variable such as its linkage.
*/