Lines Matching refs:idx

720 static Elf_Scn *elf_sec_by_idx(const struct bpf_object *obj, size_t idx);
726 static Elf64_Shdr *elf_sec_hdr_by_idx(const struct bpf_object *obj, size_t idx, Elf64_Shdr *sheader);
731 static const char *elf_sec_name_by_idx(const struct bpf_object *obj, size_t idx);
737 static Elf_Data *elf_sec_data_by_idx(const struct bpf_object *obj, size_t idx, Elf_Data *data);
739 static Elf64_Sym *elf_sym_by_idx(const struct bpf_object *obj, size_t idx);
740 static Elf64_Rel *elf_rel_by_idx(Elf_Data *data, size_t idx);
2789 static bool section_have_execinstr(struct bpf_object *obj, int idx)
2793 sh = elf_sec_hdr(obj, elf_sec_by_idx(obj, idx));
2796 sh = elf_sec_hdr_by_idx(obj, idx, &header);
3439 static Elf_Scn *elf_sec_by_idx(const struct bpf_object *obj, size_t idx)
3443 scn = elf_getscn(obj->efile.elf, idx);
3446 idx, obj->path, elf_errmsg(-1));
3510 static Elf64_Shdr *elf_sec_hdr_by_idx(const struct bpf_object *obj, size_t idx, Elf64_Shdr *sheader)
3512 psection_t psection = elfio_get_section_by_index(obj->efile.elf, idx);
3528 static const char *elf_sec_name_by_idx(const struct bpf_object *obj, size_t idx)
3533 elf_sec_hdr_by_idx(obj, idx, &sh);
3538 idx, obj->path, elf_errmsg(-1));
3575 static Elf_Data *elf_sec_data_by_idx(const struct bpf_object *obj, size_t idx, Elf_Data *data)
3578 psection_t psection_index = elfio_get_section_by_index(elf, idx);
3586 static Elf64_Sym *elf_sym_by_idx(const struct bpf_object *obj, size_t idx)
3588 if (idx >= obj->efile.symbols->d_size / sizeof(Elf64_Sym))
3591 return (Elf64_Sym *)obj->efile.symbols->d_buf + idx;
3594 static Elf64_Rel *elf_rel_by_idx(Elf_Data *data, size_t idx)
3596 if (idx >= data->d_size / sizeof(Elf64_Rel))
3599 return (Elf64_Rel *)data->d_buf + idx;
3664 int idx = 0, err = 0;
3723 idx = elf_ndxscn(scn);
3735 obj->efile.symbols_shndx = idx;
3779 idx = elf_ndxscn(scn);
3781 idx = i;
3783 sec_desc = &obj->efile.secs[idx];
3810 idx, name, (unsigned long)data->d_size,
3826 obj->efile.btf_maps_shndx = idx;
3840 obj->efile.text_shndx = idx;
3841 err = bpf_object__add_programs(obj, data, name, idx);
3877 obj->efile.st_ops_shndx = idx;
3880 idx, name);
3895 idx, name, targ_sec_idx,
3899 idx, name, targ_sec_idx,
3922 pr_info("elf: skipping section(%d) %s (size %zu)\n", idx, name,
3927 if (!obj->efile.strtabidx || obj->efile.strtabidx > idx) {
7182 int idx;
7194 idx = shdr->sh_info;
7201 if (idx == obj->efile.st_ops_shndx || idx == obj->efile.st_ops_link_shndx)
7203 else if (idx == obj->efile.btf_maps_shndx)
8970 ssize_t idx;
8985 idx = (p - obj->programs) + (forward ? 1 : -1);
8986 if (idx >= obj->nr_programs || idx < 0)
8988 return &obj->programs[idx];
10188 ssize_t idx;
10203 idx = (m - obj->maps) + i;
10204 if (idx >= obj->nr_maps || idx < 0)
10206 return &obj->maps[idx];