From: Jose E. Marchesi Date: Tue, 7 May 2024 07:42:26 +0000 (+0200) Subject: bpf: Avoid __hidden__ attribute in static object X-Git-Tag: v6.10-rc1~153^2~13^2~24^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ce987e1650216638b2b5f44948c6efea67038ae;p=thirdparty%2Fkernel%2Flinux.git bpf: Avoid __hidden__ attribute in static object An object defined as `static' defaults to hidden visibility. If additionally the visibility(__weak__) compiler attribute is applied to the declaration of the object, GCC warns that the attribute gets ignored. This patch removes the only instance of this problem among the BPF selftests. Tested in bpf-next master. Signed-off-by: Jose E. Marchesi Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20240507074227.4523-2-jose.marchesi@oracle.com --- diff --git a/tools/testing/selftests/bpf/progs/cpumask_common.h b/tools/testing/selftests/bpf/progs/cpumask_common.h index c705d8112a355..b979e91f55f07 100644 --- a/tools/testing/selftests/bpf/progs/cpumask_common.h +++ b/tools/testing/selftests/bpf/progs/cpumask_common.h @@ -9,7 +9,7 @@ int err; -#define private(name) SEC(".bss." #name) __hidden __attribute__((aligned(8))) +#define private(name) SEC(".bss." #name) __attribute__((aligned(8))) private(MASK) static struct bpf_cpumask __kptr * global_mask; struct __cpumask_map_value {