Messages in this thread | | | Date | Wed, 27 May 2015 18:44:33 -0700 | From | Alexei Starovoitov <> | Subject | Re: [RFC PATCH v4 06/29] bpf tools: Open eBPF object file and do basic validation |
| |
On Wed, May 27, 2015 at 05:19:41AM +0000, Wang Nan wrote: > This patch defines basic interface of libbpf. 'struct bpf_object' will > be the handler of each object file. Its internal structure is hide to > user. eBPF object files are compiled by LLVM as ELF format. In this > patch, libelf is used to open those files, read EHDR and do basic > validation according to e_type and e_machine. > > All elf related staffs are grouped together and reside in efile field of > 'struct bpf_object'. bpf_object__elf_finish() is introduced to clear it. > > After all eBPF programs in an object file are loaded, related ELF > information is useless. Close the object file and free those memory. > > zfree() and zclose() are introduced to ensure setting NULL pointers and > negative file descriptors after resources are released. > > Signed-off-by: Wang Nan <wangnan0@huawei.com>
the __ notation actually looks good in this context. Acked-by: Alexei Starovoitov <ast@plumgrid.com>
btw, you didn't cc me on this set, luckily I found it on lkml.
| |