Skip to contentSkip to conversation

libbpf: Provide GELF_ST_VISIBILITY() define for older libelf

PATCH Applied Arnaldo Carvalho de Melo 2 participants 2 messages May 8, 2021 – May 11, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libbpf: Provide GELF_ST_VISIBILITY() define for older libelf

Where that macro isn't available.

Cc Alexei Starovoitov <[email protected]>
Cc Andrii Nakryiko <[email protected]>
Cc Jiri Olsa <[email protected]>
---
 tools/lib/bpf/libbpf_internal.h | 5 +++++
 1 file changed, 5 insertions(+)
tools/lib/bpf/libbpf_internal.h +5 -0
index ee426226928f1283..acbcf6c7bdf82cf2 100644
@@ -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)
Signature · 1 line
2.26.3
#1 lore raw
This patch was applied to bpf/bpf.git (refs/heads/master):

Hello:

This patch was applied to bpf/bpf.git (refs/heads/master):

Quoted 8 lines · On Sat, 8 May 2021 12:22:12 -0300 you wrote:

Where that macro isn't available.

Cc Alexei Starovoitov <[email protected]>
Cc Andrii Nakryiko <[email protected]>
Cc Jiri Olsa <[email protected]>

[...]

Here is the summary with links:
- [1/1] libbpf: Provide GELF_ST_VISIBILITY() define for older libelf

    https://git.kernel.org/bpf/bpf/c/67e7ec0bd453

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html