libbpf: Replace elf_state->st_ops_* fields with SEC_ST_OPS sec_type
authorEduard Zingerman <eddyz87@gmail.com>
Wed, 6 Mar 2024 10:45:24 +0000 (12:45 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 6 Mar 2024 23:18:15 +0000 (15:18 -0800)
commit240bf8a5162e8c43cf368909582a01082d494d79
treecdaac97bf8b0e3bc431f47562503e871a1c88500
parent651d49f15b2a84b3bcfe950fa99c3672b9619dbd
libbpf: Replace elf_state->st_ops_* fields with SEC_ST_OPS sec_type

The next patch would add two new section names for struct_ops maps.
To make working with multiple struct_ops sections more convenient:
- remove fields like elf_state->st_ops_{shndx,link_shndx};
- mark section descriptions hosting struct_ops as
  elf_sec_desc->sec_type == SEC_ST_OPS;

After these changes struct_ops sections could be processed uniformly
by iterating bpf_object->efile.secs entries.

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240306104529.6453-11-eddyz87@gmail.com
tools/lib/bpf/libbpf.c