summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@kernel.org>2021-05-08 12:22:12 -0300
committerDaniel Borkmann <daniel@iogearbox.net>2021-05-11 23:07:33 +0200
commit67e7ec0bd4535fc6e6d3f5d174f80e10a8a80c6e (patch)
tree0560199caa2ad0ec0a6f4a3415504cba64cd2e25 /tools
parente2d5b2bb769fa5f500760caba76436ba3a10a895 (diff)
downloadlinux-67e7ec0bd4535fc6e6d3f5d174f80e10a8a80c6e.tar.gz
linux-67e7ec0bd4535fc6e6d3f5d174f80e10a8a80c6e.tar.bz2
linux-67e7ec0bd4535fc6e6d3f5d174f80e10a8a80c6e.zip
libbpf: Provide GELF_ST_VISIBILITY() define for older libelf
Where that macro isn't available. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/YJaspEh0qZr4LYOc@kernel.org
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/bpf/libbpf_internal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h
index ee426226928f..acbcf6c7bdf8 100644
--- a/tools/lib/bpf/libbpf_internal.h
+++ b/tools/lib/bpf/libbpf_internal.h
@@ -41,6 +41,11 @@
#define ELF_C_READ_MMAP ELF_C_READ
#endif
+/* Older libelf all end up in this expression, for both 32 and 64 bit */
+#ifndef GELF_ST_VISIBILITY
+#define GELF_ST_VISIBILITY(o) ((o) & 0x03)
+#endif
+
#define BTF_INFO_ENC(kind, kind_flag, vlen) \
((!!(kind_flag) << 31) | ((kind) << 24) | ((vlen) & BTF_MAX_VLEN))
#define BTF_TYPE_ENC(name, info, size_or_type) (name), (info), (size_or_type)