projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e2d5b2b
)
libbpf: Provide GELF_ST_VISIBILITY() define for older libelf
author
Arnaldo Carvalho de Melo
<acme@kernel.org>
Sat, 8 May 2021 15:22:12 +0000
(12:22 -0300)
committer
Daniel Borkmann
<daniel@iogearbox.net>
Tue, 11 May 2021 21:07:33 +0000
(23:07 +0200)
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
tools/lib/bpf/libbpf_internal.h
patch
|
blob
|
history
diff --git
a/tools/lib/bpf/libbpf_internal.h
b/tools/lib/bpf/libbpf_internal.h
index ee426226928f1283ddb94ce867f7922bc1e71593..acbcf6c7bdf82cf219d8e985d8f9a6e5b69e5489 100644
(file)
--- 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)