mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-01 22:29:06 +08:00
libbpf: fix error code returned on corrupted ELF
All of libbpf errors are negative, except this one. Fix it. Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
committed by
Andrii Nakryiko
parent
e977af8516
commit
c7b8b2e3a5
@@ -1221,7 +1221,7 @@ static int bpf_object__elf_collect(struct bpf_object *obj, int flags)
|
|||||||
|
|
||||||
if (!obj->efile.strtabidx || obj->efile.strtabidx >= idx) {
|
if (!obj->efile.strtabidx || obj->efile.strtabidx >= idx) {
|
||||||
pr_warning("Corrupted ELF file: index of strtab invalid\n");
|
pr_warning("Corrupted ELF file: index of strtab invalid\n");
|
||||||
return LIBBPF_ERRNO__FORMAT;
|
return -LIBBPF_ERRNO__FORMAT;
|
||||||
}
|
}
|
||||||
if (btf_data) {
|
if (btf_data) {
|
||||||
obj->btf = btf__new(btf_data->d_buf, btf_data->d_size);
|
obj->btf = btf__new(btf_data->d_buf, btf_data->d_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user