Skip to content

Commit b39e2e8

Browse files
alan-maguireKernel Patches Daemon
authored andcommitted
libbpf: Fix parsing of multi-split BTF
When creating multi-split BTF we correctly set the start string offset to be the size of the base string section plus the base BTF start string offset; the latter is needed for multi-split BTF since the offset is non-zero there. Unfortunately the BTF parsing case needed that logic and it was missed. Fixes: 4e29128 ("libbpf/btf: Fix string handling to support multi-split BTF") Signed-off-by: Alan Maguire <[email protected]>
1 parent d5592b9 commit b39e2e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/lib/bpf/btf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ static struct btf *btf_new(const void *data, __u32 size, struct btf *base_btf, b
10611061
if (base_btf) {
10621062
btf->base_btf = base_btf;
10631063
btf->start_id = btf__type_cnt(base_btf);
1064-
btf->start_str_off = base_btf->hdr->str_len;
1064+
btf->start_str_off = base_btf->hdr->str_len + base_btf->start_str_off;
10651065
}
10661066

10671067
if (is_mmap) {

0 commit comments

Comments
 (0)