Lines Matching defs:efile
654 /* Information when doing ELF related work. Only valid if efile.elf is not NULL */
655 struct elf_state efile;
811 Elf_Data *symbols = obj->efile.symbols;
847 if (sec_idx != obj->efile.text_shndx && ELF64_ST_BIND(sym->st_info) == STB_LOCAL) {
1240 err = init_struct_ops_maps(obj, STRUCT_OPS_SEC, obj->efile.st_ops_shndx,
1241 obj->efile.st_ops_data, 0);
1243 obj->efile.st_ops_link_shndx,
1244 obj->efile.st_ops_link_data,
1274 obj->efile.fd = -1;
1281 obj->efile.obj_buf = obj_buf;
1282 obj->efile.obj_buf_sz = obj_buf_sz;
1283 obj->efile.btf_maps_shndx = -1;
1284 obj->efile.st_ops_shndx = -1;
1285 obj->efile.st_ops_link_shndx = -1;
1296 if (!obj->efile.elf)
1299 elf_end(obj->efile.elf);
1300 obj->efile.elf = NULL;
1301 obj->efile.symbols = NULL;
1302 obj->efile.st_ops_data = NULL;
1303 obj->efile.st_ops_link_data = NULL;
1305 zfree(&obj->efile.secs);
1306 obj->efile.sec_cnt = 0;
1307 zclose(obj->efile.fd);
1308 obj->efile.obj_buf = NULL;
1309 obj->efile.obj_buf_sz = 0;
1318 if (obj->efile.elf) {
1323 if (obj->efile.obj_buf_sz > 0) {
1325 elf = elf_memory((char *)obj->efile.obj_buf, obj->efile.obj_buf_sz);
1327 obj->efile.fd = open(obj->path, O_RDONLY | O_CLOEXEC);
1328 if (obj->efile.fd < 0) {
1337 elf = elf_begin(obj->efile.fd, ELF_C_READ_MMAP, NULL);
1346 obj->efile.elf = elf;
1360 obj->efile.ehdr = ehdr = elf64_getehdr(elf);
1361 if (!obj->efile.ehdr) {
1367 if (elf_getshdrstrndx(elf, &obj->efile.shstrndx)) {
1375 if (!elf_rawdata(elf_getscn(elf, obj->efile.shstrndx), NULL)) {
1398 if (obj->efile.ehdr->e_ident[EI_DATA] == ELFDATA2LSB)
1401 if (obj->efile.ehdr->e_ident[EI_DATA] == ELFDATA2MSB)
1468 Elf_Data *symbols = obj->efile.symbols;
1705 for (sec_idx = 1; sec_idx < obj->efile.sec_cnt; sec_idx++) {
1706 sec_desc = &obj->efile.secs[sec_idx];
2054 ".kconfig", obj->efile.symbols_shndx,
2625 if (obj->efile.btf_maps_shndx < 0)
2628 scn = elf_sec_by_idx(obj, obj->efile.btf_maps_shndx);
2644 obj->efile.btf_maps_sec_btf_id = i;
2657 obj->efile.btf_maps_shndx,
2812 return obj->efile.btf_maps_shndx >= 0 ||
2813 obj->efile.st_ops_shndx >= 0 ||
2814 obj->efile.st_ops_link_shndx >= 0 ||
2820 return obj->efile.st_ops_shndx >= 0 || obj->efile.st_ops_link_shndx >= 0;
3205 name = elf_strptr(obj->efile.elf, obj->efile.strtabidx, off);
3219 name = elf_strptr(obj->efile.elf, obj->efile.shstrndx, off);
3233 scn = elf_getscn(obj->efile.elf, idx);
3245 Elf *elf = obj->efile.elf;
3320 if (idx >= obj->efile.symbols->d_size / sizeof(Elf64_Sym))
3323 return (Elf64_Sym *)obj->efile.symbols->d_buf + idx;
3389 Elf *elf = obj->efile.elf;
3403 if (elf_getshdrnum(obj->efile.elf, &obj->efile.sec_cnt)) {
3408 obj->efile.secs = calloc(obj->efile.sec_cnt, sizeof(*obj->efile.secs));
3409 if (!obj->efile.secs)
3422 if (obj->efile.symbols) {
3433 obj->efile.symbols = data;
3434 obj->efile.symbols_shndx = idx;
3435 obj->efile.strtabidx = sh->sh_link;
3439 if (!obj->efile.symbols) {
3448 sec_desc = &obj->efile.secs[idx];
3482 obj->efile.btf_maps_shndx = idx;
3496 obj->efile.text_shndx = idx;
3511 obj->efile.st_ops_data = data;
3512 obj->efile.st_ops_shndx = idx;
3514 obj->efile.st_ops_link_data = data;
3515 obj->efile.st_ops_link_shndx = idx;
3524 targ_sec_idx >= obj->efile.sec_cnt)
3552 if (!obj->efile.strtabidx || obj->efile.strtabidx > idx) {
3783 if (!obj->efile.symbols)
3786 scn = elf_sec_by_idx(obj, obj->efile.symbols_shndx);
3993 return prog->sec_idx == obj->efile.text_shndx && obj->nr_programs > 1;
4014 switch (obj->efile.secs[shndx].sec_type) {
4027 return shndx == obj->efile.btf_maps_shndx;
4033 if (shndx == obj->efile.symbols_shndx)
4036 switch (obj->efile.secs[shndx].sec_type) {
4100 if (!shdr_idx || shdr_idx != obj->efile.text_shndx) {
4124 if (sym_is_subprog(sym, obj->efile.text_shndx)) {
4250 if (sec_idx >= obj->efile.sec_cnt)
4282 if (sym->st_shndx >= obj->efile.sec_cnt) {
4346 if (map->sec_idx == obj->efile.btf_maps_shndx || bpf_map__is_struct_ops(map))
6307 subprog = find_prog_by_sec_insn(obj, obj->efile.text_shndx, sub_insn_idx);
6616 if (!obj->efile.btf_maps_sec_btf_id || !obj->btf)
6618 sec = btf__type_by_id(obj->btf, obj->efile.btf_maps_sec_btf_id);
6644 if (map->sec_idx != obj->efile.btf_maps_shndx)
6662 if (sym->st_shndx != obj->efile.btf_maps_shndx) {
6740 for (i = 0; i < obj->efile.sec_cnt; i++) {
6741 struct elf_sec_desc *sec_desc = &obj->efile.secs[i];
6758 if (idx == obj->efile.st_ops_shndx || idx == obj->efile.st_ops_link_shndx)
6760 else if (idx == obj->efile.btf_maps_shndx)