Lines Matching refs:ehdr
44 GElf_Ehdr *ehdr; in elf_getphdrnum() local
46 ehdr = gelf_getehdr(elf, &gehdr); in elf_getphdrnum()
47 if (!ehdr) in elf_getphdrnum()
50 *dst = ehdr->e_phnum; in elf_getphdrnum()
227 GElf_Ehdr ehdr; in dso__synthesize_plt_symbols() local
236 ehdr = ss->ehdr; in dso__synthesize_plt_symbols()
245 scn_plt_rel = elf_section_by_name(elf, &ehdr, &shdr_rel_plt, in dso__synthesize_plt_symbols()
248 scn_plt_rel = elf_section_by_name(elf, &ehdr, &shdr_rel_plt, in dso__synthesize_plt_symbols()
259 if (elf_section_by_name(elf, &ehdr, &shdr_plt, ".plt", NULL) == NULL) in dso__synthesize_plt_symbols()
352 GElf_Ehdr ehdr; in elf_read_build_id() local
366 if (gelf_getehdr(elf, &ehdr) == NULL) { in elf_read_build_id()
378 sec = elf_section_by_name(elf, &ehdr, &shdr, in elf_read_build_id()
383 sec = elf_section_by_name(elf, &ehdr, &shdr, in elf_read_build_id()
388 sec = elf_section_by_name(elf, &ehdr, &shdr, in elf_read_build_id()
505 GElf_Ehdr ehdr; in filename__read_debuglink() local
525 if (gelf_getehdr(elf, &ehdr) == NULL) { in filename__read_debuglink()
530 sec = elf_section_by_name(elf, &ehdr, &shdr, in filename__read_debuglink()
637 GElf_Ehdr ehdr; in symsrc__init() local
660 if (gelf_getehdr(elf, &ehdr) == NULL) { in symsrc__init()
666 if (dso__swap_init(dso, ehdr.e_ident[EI_DATA])) { in symsrc__init()
688 ss->symtab = elf_section_by_name(elf, &ehdr, &ss->symshdr, ".symtab", in symsrc__init()
694 ss->dynsym = elf_section_by_name(elf, &ehdr, &ss->dynshdr, ".dynsym", in symsrc__init()
700 ss->opdsec = elf_section_by_name(elf, &ehdr, &ss->opdshdr, ".opd", in symsrc__init()
707 ss->adjust_symbols = (ehdr.e_type == ET_EXEC || in symsrc__init()
708 ehdr.e_type == ET_REL || in symsrc__init()
710 elf_section_by_name(elf, &ehdr, &shdr, in symsrc__init()
714 ss->adjust_symbols = ehdr.e_type == ET_EXEC || in symsrc__init()
715 ehdr.e_type == ET_REL; in symsrc__init()
726 ss->ehdr = ehdr; in symsrc__init()
786 GElf_Ehdr ehdr; in dso__load_sym() local
800 dso->rel = syms_ss->ehdr.e_type == ET_REL; in dso__load_sym()
823 ehdr = syms_ss->ehdr; in dso__load_sym()
842 sec_strndx = elf_getscn(runtime_ss->elf, runtime_ss->ehdr.e_shstrndx); in dso__load_sym()
894 if (ehdr.e_machine == EM_ARM || ehdr.e_machine == EM_AARCH64) { in dso__load_sym()
933 if ((ehdr.e_machine == EM_ARM) && in dso__load_sym()
1146 GElf_Ehdr ehdr; in dso__type_fd() local
1163 if (gelf_getehdr(elf, &ehdr) == NULL) in dso__type_fd()
1166 if (ehdr.e_machine == EM_X86_64) in dso__type_fd()
1221 GElf_Ehdr ehdr; member
1226 GElf_Ehdr *ehdr; in kcore__open() local
1240 ehdr = gelf_getehdr(kcore->elf, &kcore->ehdr); in kcore__open()
1241 if (!ehdr) in kcore__open()
1272 memset(&kcore->ehdr, 0, sizeof(GElf_Ehdr)); in kcore__init()
1292 GElf_Ehdr *ehdr = &to->ehdr; in kcore__copy_hdr() local
1293 GElf_Ehdr *kehdr = &from->ehdr; in kcore__copy_hdr()
1295 memcpy(ehdr->e_ident, kehdr->e_ident, EI_NIDENT); in kcore__copy_hdr()
1296 ehdr->e_type = kehdr->e_type; in kcore__copy_hdr()
1297 ehdr->e_machine = kehdr->e_machine; in kcore__copy_hdr()
1298 ehdr->e_version = kehdr->e_version; in kcore__copy_hdr()
1299 ehdr->e_entry = 0; in kcore__copy_hdr()
1300 ehdr->e_shoff = 0; in kcore__copy_hdr()
1301 ehdr->e_flags = kehdr->e_flags; in kcore__copy_hdr()
1302 ehdr->e_phnum = count; in kcore__copy_hdr()
1303 ehdr->e_shentsize = 0; in kcore__copy_hdr()
1304 ehdr->e_shnum = 0; in kcore__copy_hdr()
1305 ehdr->e_shstrndx = 0; in kcore__copy_hdr()
1308 ehdr->e_phoff = sizeof(Elf32_Ehdr); in kcore__copy_hdr()
1309 ehdr->e_ehsize = sizeof(Elf32_Ehdr); in kcore__copy_hdr()
1310 ehdr->e_phentsize = sizeof(Elf32_Phdr); in kcore__copy_hdr()
1312 ehdr->e_phoff = sizeof(Elf64_Ehdr); in kcore__copy_hdr()
1313 ehdr->e_ehsize = sizeof(Elf64_Ehdr); in kcore__copy_hdr()
1314 ehdr->e_phentsize = sizeof(Elf64_Phdr); in kcore__copy_hdr()
1317 if (!gelf_update_ehdr(to->elf, ehdr)) in kcore__copy_hdr()