summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2021-05-07 07:41:17 +0200
committerAlexei Starovoitov <ast@kernel.org>2021-05-12 00:07:17 +0200
commit247b8634e6446dbc8024685f803290501cba226f (patch)
treea7131ff55bee67aa9035b1517b9e89a0619fbedc /tools
parentbpftool: Stop emitting static variables in BPF skeleton (diff)
downloadlinux-247b8634e6446dbc8024685f803290501cba226f.tar.xz
linux-247b8634e6446dbc8024685f803290501cba226f.zip
libbpf: Fix ELF symbol visibility update logic
Fix silly bug in updating ELF symbol's visibility. Fixes: a46349227cd8 ("libbpf: Add linker extern resolution support for functions and global variables") Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20210507054119.270888-6-andrii@kernel.org
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/bpf/linker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c
index 3b1fbc27be37..b594a88620ce 100644
--- a/tools/lib/bpf/linker.c
+++ b/tools/lib/bpf/linker.c
@@ -1788,7 +1788,7 @@ static void sym_update_visibility(Elf64_Sym *sym, int sym_vis)
/* libelf doesn't provide setters for ST_VISIBILITY,
* but it is stored in the lower 2 bits of st_other
*/
- sym->st_other &= 0x03;
+ sym->st_other &= ~0x03;
sym->st_other |= sym_vis;
}