diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c index b82a78d6d957b8a5217cc9a405ad11c0826e1a91..488029cb4e422f6a676d4431734499855fd43547 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; }