Ensure the ELF reader works for objects built without BTF
Follow-up to https://github.com/cilium/ebpf/pull/1807.
Loading BPF objects without BTF info has always been supported, and although there's little reason to disable compiling with BTF nowadays, we should have at least some tests that somewhat verify this doesn't regress. Some users may not need BTF or don't want their users to be able to inspect it. Either we decide to always require BTF (feels heavy-handed and unnecessary), or we ensure it keeps working.
Some suggestions:
- Build loader.c without BTF on the latest toolchain. Most map defs are BTF, but there are still some legacy ones. Add a test that loads it and compares the CollectionSpec to a well-known definition like
TestLoadCollectionSpec. - Separate .c file with a subset of loader.c to lower the footprint of the test.
- Run some discovery in the code base to find code paths that require BTF and make sure proper errors are returned and there are no panics.
can I work on this ?
@7h3-3mp7y-m4n Sure! Assigned the issue to you.
Hey! I also wanted to work on this. @7h3-3mp7y-m4n, are you busy? If so, can I pick this up?
If you are that eager, then you can pick this up! Good luck @Al-Masih-ad-Dajjal
hey @ti-mo , can you please assign this to me ?
Hi, I’d like to work on this issue. Could you assign me if it’s still available?
Hi, I appreciate the interest, but given there's little movement here I'll remove all current assignments and leave it that way. If someone ends up finding some improvements in this area, please just send a PR. Thank you!