Lines Matching defs:elf
632 Elf *elf;
634 pelfio_t elf;
681 /* Information when doing ELF related work. Only valid if efile.elf is not NULL */
1324 * avoid user freeing them before elf finish.
1341 if (!obj->efile.elf)
1344 elf_end(obj->efile.elf);
1352 elfio_delete(obj->efile.elf);
1354 obj->efile.elf = NULL;
1371 Elf *elf;
1373 pelfio_t elf;
1376 if (obj->efile.elf) {
1377 pr_warn("elf: init internal error\n");
1384 elf = elf_memory((char *)obj->efile.obj_buf, obj->efile.obj_buf_sz);
1387 elf = elfio_new();
1392 elfio_load(elf, memfd_path);
1401 pr_warn("elf: failed to open %s: %s\n", obj->path, cp);
1405 elf = elf_begin(obj->efile.fd, ELF_C_READ_MMAP, NULL);
1409 if (!elf) {
1410 pr_warn("elf: failed to open %s as ELF file: %s\n", obj->path, elf_errmsg(-1));
1415 obj->efile.elf = elf;
1417 if (elf_kind(elf) != ELF_K_ELF) {
1419 pr_warn("elf: '%s' is not a proper ELF object\n", obj->path);
1423 if (gelf_getclass(elf) != ELFCLASS64) {
1425 if (elfio_get_class(elf) != ELFCLASS64 ) {
1428 pr_warn("elf: '%s' is not a 64-bit ELF object\n", obj->path);
1432 obj->efile.ehdr = ehdr = elf64_getehdr(elf);
1437 pr_warn("elf: failed to get ELF header from %s: %s\n", obj->path, elf_errmsg(-1));
1443 if (elf_getshdrstrndx(elf, &obj->efile.shstrndx)) {
1444 pr_warn("elf: failed to get section names section index for %s: %s\n",
1451 if (!elf_rawdata(elf_getscn(elf, obj->efile.shstrndx), NULL)) {
1452 pr_warn("elf: failed to get section names strings from %s: %s\n",
1458 obj->efile.shstrndx = elfio_get_section_name_str_index(elf);
1462 pr_warn("elf: %s is not a valid eBPF object file\n", obj->path);
1484 pr_warn("elf: endianness mismatch in %s.\n", obj->path);
2735 pr_warn("elf: failed to get %s map definitions for %s\n",
3004 pelfio_t elf = obj->efile.elf;
3005 sec_obj = elfio_get_section_by_name(elf, sec_name);
3407 name = elf_strptr(obj->efile.elf, obj->efile.strtabidx, off);
3412 pr_warn("elf: failed to get section name string at offset %zu from %s: %s\n",
3424 name = elf_strptr(obj->efile.elf, obj->efile.shstrndx, off);
3430 pr_warn("elf: failed to get section name string at offset %zu from %s: %s\n",
3443 scn = elf_getscn(obj->efile.elf, idx);
3445 pr_warn("elf: failed to get section(%zu) from %s: %s\n",
3455 Elf *elf = obj->efile.elf;
3458 while ((scn = elf_nextscn(elf, scn)) != NULL) {
3480 pr_warn("elf: failed to get section(%zu) header from %s: %s\n",
3502 pr_warn("elf: failed to get section(%zu) name from %s: %s\n",
3512 psection_t psection = elfio_get_section_by_index(obj->efile.elf, idx);
3537 pr_warn("elf: failed to get section(%zu) name from %s: %s\n",
3556 pr_warn("elf: failed to get section(%zu) %s data from %s: %s\n",
3567 pelfio_t elf = obj->efile.elf;
3568 psection_t psection_name = elfio_get_section_by_name(elf, name);
3577 pelfio_t elf = obj->efile.elf;
3578 psection_t psection_index = elfio_get_section_by_index(elf, idx);
3658 Elf *elf = obj->efile.elf;
3660 pelfio_t elf = obj->efile.elf;
3682 if (elf_getshdrnum(obj->efile.elf, &obj->efile.sec_cnt)) {
3683 pr_warn("elf: failed to get the number of sections for %s: %s\n",
3688 obj->efile.sec_cnt = elfio_get_sections_num(elf);
3699 while ((scn = elf_nextscn(elf, scn)) != NULL) {
3702 int secno = elfio_get_sections_num(elf);
3712 pr_warn("elf: multiple symbol tables in %s\n", obj->path);
3747 psection_t psection = elfio_get_section_by_index(elf, obj->efile.strtabidx);
3752 psection = elfio_get_section_by_index(elf, obj->efile.shstrndx);
3764 pr_warn("elf: couldn't find symbol table in %s, stripped object file?\n",
3771 while ((scn = elf_nextscn(elf, scn)) != NULL) {
3774 psection_t ptmpsection = elfio_get_section_by_index(elf, i);
3809 pr_debug("elf: section(%d) %s, size %ld, link %d, flags %lx, type=%d\n",
3823 pr_warn("elf: legacy map definitions in 'maps' section are not supported by libbpf v1.0+\n");
3879 pr_info("elf: skipping unrecognized data section(%d) %s\n",
3894 pr_info("elf: skipping relo section(%d) %s for section(%d) %s\n",
3898 pr_info("elf: skipping relo section(%d) %s for section(%d) %s\n",
3922 pr_info("elf: skipping section(%d) %s (size %zu)\n", idx, name,
3928 pr_warn("elf: symbol strings section missing or invalid in %s\n", obj->path);
11576 Elf *elf;
11578 pelfio_t elf;
11604 elf = elf_memory((void *)entry.data, entry.data_length);
11607 elf = elfio_new();
11612 elfio_load(elf, memfd_path);
11614 if (!elf) {
11615 pr_warn("elf: could not read elf file %s from %s: %s\n", file_name, archive_path,
11621 ret = elf_find_func_offset(elf, file_name, func_name);
11623 pr_debug("elf: symbol address match for %s of %s in %s: 0x%x + 0x%lx = 0x%lx\n",
11629 elf_end(elf);
11631 elfio_delete(elf);