Skip to content

libbpf: Fix inheritance of BTF pointer size #8984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

guidosarducci
Copy link
Contributor

Update btf_new_empty() to copy the pointer size from a provided base BTF. This ensures split BTF works properly and fixes test failures seen on 32-bit targets:

root@qemu-armhf:/usr/libexec/kselftests-bpf# ./test_progs -a btf_split
__test_btf_split:PASS:empty_main_btf 0 nsec
__test_btf_split:PASS:main_ptr_sz 0 nsec
__test_btf_split:PASS:empty_split_btf 0 nsec
__test_btf_split:FAIL:inherit_ptr_sz unexpected inherit_ptr_sz: actual 4 != expected 8
[...]
#41/1 btf_split/single_split:FAIL

Fixes: ba45136 ("libbpf: Implement basic split BTF support")

Update btf_new_empty() to copy the pointer size from a provided base BTF.
This ensures split BTF works properly and fixes test failures seen on
32-bit targets:

  root@qemu-armhf:/usr/libexec/kselftests-bpf# ./test_progs -a btf_split
  __test_btf_split:PASS:empty_main_btf 0 nsec
  __test_btf_split:PASS:main_ptr_sz 0 nsec
  __test_btf_split:PASS:empty_split_btf 0 nsec
  __test_btf_split:FAIL:inherit_ptr_sz unexpected inherit_ptr_sz: actual 4 != expected 8
  [...]
  kernel-patches#41/1    btf_split/single_split:FAIL

Fixes: ba45136 ("libbpf: Implement basic split BTF support")
Signed-off-by: Tony Ambardar <[email protected]>
@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot force-pushed the bpf-next_base branch 15 times, most recently from 21880e2 to 86d7ac4 Compare May 29, 2025 05:16
@kernel-patches-daemon-bpf
Copy link

Automatically cleaning up stale PR; feel free to reopen if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant