mirror of
https://github.com/raspberrypi/linux.git
synced 2026-01-04 18:27:36 +00:00
libbpf: Add elf_open/elf_close functions
Adding elf_open/elf_close functions and using it in elf_find_func_offset_from_file function. It will be used in following changes to save some common code. Acked-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/r/20230809083440.3209381-10-jolsa@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
committed by
Alexei Starovoitov
parent
5c74272504
commit
f90eb70d44
@@ -581,4 +581,12 @@ int sys_bpf_prog_load(union bpf_attr *attr, unsigned int size, int attempts);
|
||||
long elf_find_func_offset(Elf *elf, const char *binary_path, const char *name);
|
||||
long elf_find_func_offset_from_file(const char *binary_path, const char *name);
|
||||
|
||||
struct elf_fd {
|
||||
Elf *elf;
|
||||
int fd;
|
||||
};
|
||||
|
||||
int elf_open(const char *binary_path, struct elf_fd *elf_fd);
|
||||
void elf_close(struct elf_fd *elf_fd);
|
||||
|
||||
#endif /* __LIBBPF_LIBBPF_INTERNAL_H */
|
||||
|
||||
Reference in New Issue
Block a user