Re: [PATCH bpf-next 3/3] libbpf: Use string table index from index table if needed

2021-01-21 Thread Andrii Nakryiko
On Thu, Jan 21, 2021 at 12:26 PM Jiri Olsa wrote: > > 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 direct

[PATCH bpf-next 3/3] libbpf: Use string table index from index table if needed

2021-01-21 Thread Jiri Olsa
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 --- tools/lib/bp

Re: [PATCH bpf-next 3/3] libbpf: Use string table index from index table if needed

2021-01-20 Thread Jiri Olsa
On Tue, Jan 19, 2021 at 05:22:08PM -0800, Andrii Nakryiko wrote: > On Tue, Jan 19, 2021 at 2:15 PM Jiri Olsa wrote: > > > > 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. > > > > In such case

Re: [PATCH bpf-next 3/3] libbpf: Use string table index from index table if needed

2021-01-20 Thread Arnaldo Carvalho de Melo
Em Tue, Jan 19, 2021 at 05:22:08PM -0800, Andrii Nakryiko escreveu: > On Tue, Jan 19, 2021 at 2:15 PM Jiri Olsa wrote: > > > > 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. > > > > In such ca

Re: [PATCH bpf-next 3/3] libbpf: Use string table index from index table if needed

2021-01-19 Thread Andrii Nakryiko
On Tue, Jan 19, 2021 at 2:15 PM Jiri Olsa wrote: > > 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. > > In such case we need to call elf_getshdrstrndx to get the > proper string table index. > > S

[PATCH bpf-next 3/3] libbpf: Use string table index from index table if needed

2021-01-19 Thread Jiri Olsa
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. In such case we need to call elf_getshdrstrndx to get the proper string table index. Signed-off-by: Jiri Olsa --- tools/lib/bpf/btf.c | 14 +++