From: Andi Kleen <ak@xxxxxxxxxxxxxxx> gcc LTO has a problem that can cause static variables containing && labels to be put into a different LTO partition and then fail the build. This can happen with the jump table in the BPF interprer. Mark the interpreter function and the jump table as __noreorder, this guarantees they both end up in the first partition. Cc: Alexei Starovoitov <ast@xxxxxxxxxx> Cc: Daniel Borkmann <daniel@xxxxxxxxxxxxx> Cc: John Fastabend <john.fastabend@xxxxxxxxx> Cc: Andrii Nakryiko <andrii@xxxxxxxxxx> Cc: Martin KaFai Lau <martin.lau@xxxxxxxxx> Cc: Song Liu <song@xxxxxxxxxx> Cc: Yonghong Song <yhs@xxxxxx> Cc: KP Singh <kpsingh@xxxxxxxxxx> Cc: Stanislav Fomichev <sdf@xxxxxxxxxx> Cc: Hao Luo <haoluo@xxxxxxxxxx> Cc: Jiri Olsa <jolsa@xxxxxxxxxx> Cc: bpf@xxxxxxxxxxxxxxx Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx> Signed-off-by: Martin Liska <mliska@xxxxxxx> Signed-off-by: Jiri Slaby <jslaby@xxxxxxx> --- kernel/bpf/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 25a54e04560e..d40ce00622f6 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -1640,7 +1640,7 @@ u64 __weak bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr) * * Return: whatever value is in %BPF_R0 at program exit */ -static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn) +static u64 __noreorder ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn) { #define BPF_INSN_2_LBL(x, y) [BPF_##x | BPF_##y] = &&x##_##y #define BPF_INSN_3_LBL(x, y, z) [BPF_##x | BPF_##y | BPF_##z] = &&x##_##y##_##z -- 2.38.1