]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Use string table index from index table if needed
authorJiri Olsa <jolsa@kernel.org>
Thu, 21 Jan 2021 20:22:03 +0000 (21:22 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 21 Jan 2021 23:38:01 +0000 (15:38 -0800)
commitb395d23e0e8bc87e5ec32ec492b83b3f65b4e2cc
tree0c34fa1f2a08cccb91c920318a011df018904a32
parent3355c37ea7bd1e0f9e15454450f8f6b3ac8e6a87
libbpf: Use string table index from index table if needed

For very large ELF objects (with many sections), we could
get special value SHN_XINDEX (65535) for elf object's string
table index - e_shstrndx.

Call elf_getshdrstrndx to get the proper string table index,
instead of reading it directly from ELF header.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210121202203.9346-4-jolsa@kernel.org
tools/lib/bpf/btf.c