Skip to content

Commit

Permalink
libbpf: Fix ELF symbol visibility update logic
Browse files Browse the repository at this point in the history
[ Upstream commit 247b863 ]

Fix silly bug in updating ELF symbol's visibility.

Fixes: a463492 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
anakryiko authored and gregkh committed Jul 14, 2021
1 parent 47bba47 commit 26bbe38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/lib/bpf/linker.c
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,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;
}

Expand Down

0 comments on commit 26bbe38

Please sign in to comment.