aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2022-04-25 17:45:02 -0700
committerAlexei Starovoitov <ast@kernel.org>2022-04-26 15:41:45 -0700
commitafe98d46ba22316acfd198eb5cd4db2ef2d427d7 (patch)
tree6dc9bd603c19a8ff39165f0d6a57ef59ad15cf67 /tools/lib/bpf
parentbpf: Compute map_btf_id during build time (diff)
downloadlinux-dev-afe98d46ba22316acfd198eb5cd4db2ef2d427d7.tar.xz
linux-dev-afe98d46ba22316acfd198eb5cd4db2ef2d427d7.zip
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 <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20220426004511.2691730-2-andrii@kernel.org
Diffstat (limited to 'tools/lib/bpf')
-rw-r--r--tools/lib/bpf/relo_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/relo_core.c b/tools/lib/bpf/relo_core.c
index f946f23eab20..adaa22160692 100644
--- a/tools/lib/bpf/relo_core.c
+++ b/tools/lib/bpf/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;