diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index fa45f5643c9b2a6dec67a10cc81973fca53a1f81..4d182a9313f861781cbca907146698dc6edea843 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -2992,6 +2992,12 @@ static int bpf_object__elf_collect(struct bpf_object *obj) } } + if (!obj->efile.symbols) { + pr_warn("elf: couldn't find symbol table in %s, stripped object file?\n", + obj->path); + return -ENOENT; + } + scn = NULL; while ((scn = elf_nextscn(elf, scn)) != NULL) { idx++;