From 36582ee432b16afff8a1ca82039677b4df4d4e02 Mon Sep 17 00:00:00 2001 From: Andrii Nakryiko Date: Mon, 25 Apr 2022 17:45:02 -0700 Subject: [PATCH] libbpf: Fix anonymous type check in CO-RE logic Use type name for checking whether CO-RE relocation is referring to anonymous type. Using spec string makes no sense. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220426004511.2691730-2-andrii@kernel.org --- src/relo_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/relo_core.c b/src/relo_core.c index f946f23..adaa221 100644 --- a/src/relo_core.c +++ b/src/relo_core.c @@ -1207,7 +1207,7 @@ int bpf_core_calc_relo_insn(const char *prog_name, } /* libbpf doesn't support candidate search for anonymous types */ - if (str_is_empty(spec_str)) { + if (str_is_empty(local_name)) { pr_warn("prog '%s': relo #%d: <%s> (%d) relocation doesn't support anonymous types\n", prog_name, relo_idx, core_relo_kind_str(relo->kind), relo->kind); return -EOPNOTSUPP;