Add eBPF map information to the generated elf file
chengshuyi opened this issue · 2 comments
chengshuyi commented
The following steps may be involved:
- Add eBPF map information to the map segment
- Add the relocate information of eBPF map
- Write test cases, involving a simple eBPF program, using an eBPF map, and using libbpf-rs to load and pass.
For details, please refer to the logic of Libbpf processing. The functions that may be involved in libbpf include bpf_object__elf_collect (collecting elf information, such as eBPF program instructions, map information, relocation information, etc.) and bpf_object__relocate_data (mainly relocating map information, that is, the map's fd )
LavenderQAQ commented
/assign
chengshuyi commented
This part seems complicated. I'll see if the libbpf can provide a method to construct a bpf_program instance to facilitate our loading of the eBPF program.
[1] https://lore.kernel.org/bpf/686fce03-cee7-c268-8bfc-ce49230210b9@linux.alibaba.com/T/#u