summaryrefslogtreecommitdiff
path: root/lib/xz/xz_dec_lzma2.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2023-08-09 11:34:22 +0300
committerAlexei Starovoitov <ast@kernel.org>2023-08-22 01:51:26 +0300
commit3774705db1718a671a4ed2ac5066fea839b1d7d1 (patch)
tree2d8d2529beb35b7d8ee46affad45c5ae8744d9f1 /lib/xz/xz_dec_lzma2.c
parentf90eb70d4489ea6fa6f3a7638aa614e15ad7181f (diff)
downloadlinux-3774705db1718a671a4ed2ac5066fea839b1d7d1.tar.xz
libbpf: Add elf symbol iterator
Adding elf symbol iterator object (and some functions) that follow open-coded iterator pattern and some functions to ease up iterating elf object symbols. The idea is to iterate single symbol section with: struct elf_sym_iter iter; struct elf_sym *sym; if (elf_sym_iter_new(&iter, elf, binary_path, SHT_DYNSYM)) goto error; while ((sym = elf_sym_iter_next(&iter))) { ... } I considered opening the elf inside the iterator and iterate all symbol sections, but then it gets more complicated wrt user checks for when the next section is processed. Plus side is the we don't need 'exit' function, because caller/user is in charge of that. The returned iterated symbol object from elf_sym_iter_next function is placed inside the struct elf_sym_iter, so no extra allocation or argument is needed. Suggested-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/r/20230809083440.3209381-11-jolsa@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'lib/xz/xz_dec_lzma2.c')
0 files changed, 0 insertions, 0 deletions