Lines Matching refs:ehdr

81 	GElf_Ehdr *ehdr;  in elf_getphdrnum()  local
83 ehdr = gelf_getehdr(elf, &gehdr); in elf_getphdrnum()
84 if (!ehdr) in elf_getphdrnum()
87 *dst = ehdr->e_phnum; in elf_getphdrnum()
299 GElf_Ehdr ehdr; in dso__synthesize_plt_symbols() local
308 ehdr = ss->ehdr; in dso__synthesize_plt_symbols()
317 scn_plt_rel = elf_section_by_name(elf, &ehdr, &shdr_rel_plt, in dso__synthesize_plt_symbols()
320 scn_plt_rel = elf_section_by_name(elf, &ehdr, &shdr_rel_plt, in dso__synthesize_plt_symbols()
331 if (elf_section_by_name(elf, &ehdr, &shdr_plt, ".plt", NULL) == NULL) in dso__synthesize_plt_symbols()
359 switch (ehdr.e_machine) { in dso__synthesize_plt_symbols()
464 GElf_Ehdr ehdr; in elf_read_build_id() local
478 if (gelf_getehdr(elf, &ehdr) == NULL) { in elf_read_build_id()
490 sec = elf_section_by_name(elf, &ehdr, &shdr, in elf_read_build_id()
495 sec = elf_section_by_name(elf, &ehdr, &shdr, in elf_read_build_id()
500 sec = elf_section_by_name(elf, &ehdr, &shdr, in elf_read_build_id()
729 GElf_Ehdr ehdr; in filename__read_debuglink() local
749 if (gelf_getehdr(elf, &ehdr) == NULL) { in filename__read_debuglink()
754 sec = elf_section_by_name(elf, &ehdr, &shdr, in filename__read_debuglink()
822 bool elf__needs_adjust_symbols(GElf_Ehdr ehdr) in elf__needs_adjust_symbols() argument
829 return ehdr.e_type == ET_EXEC || ehdr.e_type == ET_REL || in elf__needs_adjust_symbols()
830 ehdr.e_type == ET_DYN; in elf__needs_adjust_symbols()
836 GElf_Ehdr ehdr; in symsrc__init() local
861 if (gelf_getehdr(elf, &ehdr) == NULL) { in symsrc__init()
867 if (dso__swap_init(dso, ehdr.e_ident[EI_DATA])) { in symsrc__init()
894 ss->symtab = elf_section_by_name(elf, &ehdr, &ss->symshdr, ".symtab", in symsrc__init()
900 ss->dynsym = elf_section_by_name(elf, &ehdr, &ss->dynshdr, ".dynsym", in symsrc__init()
906 ss->opdsec = elf_section_by_name(elf, &ehdr, &ss->opdshdr, ".opd", in symsrc__init()
914 ss->adjust_symbols = elf__needs_adjust_symbols(ehdr); in symsrc__init()
924 ss->ehdr = ehdr; in symsrc__init()
1089 GElf_Ehdr ehdr; in dso__load_sym_internal() local
1103 ehdr = syms_ss->ehdr; in dso__load_sym_internal()
1112 if (elf_section_by_name(runtime_ss->elf, &runtime_ss->ehdr, &tshdr, in dso__load_sym_internal()
1131 sec_strndx = elf_getscn(runtime_ss->elf, runtime_ss->ehdr.e_shstrndx); in dso__load_sym_internal()
1139 sec_strndx = elf_getscn(elf, ehdr.e_shstrndx); in dso__load_sym_internal()
1198 if (ehdr.e_machine == EM_ARM || ehdr.e_machine == EM_AARCH64) { in dso__load_sym_internal()
1254 if ((ehdr.e_machine == EM_ARM) && in dso__load_sym_internal()
1316 dso->rel = syms_ss->ehdr.e_type == ET_REL; in dso__load_sym()
1406 GElf_Ehdr ehdr; in dso__type_fd() local
1423 if (gelf_getehdr(elf, &ehdr) == NULL) in dso__type_fd()
1426 if (ehdr.e_machine == EM_X86_64) in dso__type_fd()
1481 GElf_Ehdr ehdr; member
1486 GElf_Ehdr *ehdr; in kcore__open() local
1500 ehdr = gelf_getehdr(kcore->elf, &kcore->ehdr); in kcore__open()
1501 if (!ehdr) in kcore__open()
1532 memset(&kcore->ehdr, 0, sizeof(GElf_Ehdr)); in kcore__init()
1552 GElf_Ehdr *ehdr = &to->ehdr; in kcore__copy_hdr() local
1553 GElf_Ehdr *kehdr = &from->ehdr; in kcore__copy_hdr()
1555 memcpy(ehdr->e_ident, kehdr->e_ident, EI_NIDENT); in kcore__copy_hdr()
1556 ehdr->e_type = kehdr->e_type; in kcore__copy_hdr()
1557 ehdr->e_machine = kehdr->e_machine; in kcore__copy_hdr()
1558 ehdr->e_version = kehdr->e_version; in kcore__copy_hdr()
1559 ehdr->e_entry = 0; in kcore__copy_hdr()
1560 ehdr->e_shoff = 0; in kcore__copy_hdr()
1561 ehdr->e_flags = kehdr->e_flags; in kcore__copy_hdr()
1562 ehdr->e_phnum = count; in kcore__copy_hdr()
1563 ehdr->e_shentsize = 0; in kcore__copy_hdr()
1564 ehdr->e_shnum = 0; in kcore__copy_hdr()
1565 ehdr->e_shstrndx = 0; in kcore__copy_hdr()
1568 ehdr->e_phoff = sizeof(Elf32_Ehdr); in kcore__copy_hdr()
1569 ehdr->e_ehsize = sizeof(Elf32_Ehdr); in kcore__copy_hdr()
1570 ehdr->e_phentsize = sizeof(Elf32_Phdr); in kcore__copy_hdr()
1572 ehdr->e_phoff = sizeof(Elf64_Ehdr); in kcore__copy_hdr()
1573 ehdr->e_ehsize = sizeof(Elf64_Ehdr); in kcore__copy_hdr()
1574 ehdr->e_phentsize = sizeof(Elf64_Phdr); in kcore__copy_hdr()
1577 if (!gelf_update_ehdr(to->elf, ehdr)) in kcore__copy_hdr()
2225 GElf_Ehdr ehdr; in populate_sdt_note() local
2308 if (!gelf_getehdr(*elf, &ehdr)) { in populate_sdt_note()
2321 if (elf_section_by_name(*elf, &ehdr, &shdr, SDT_BASE_SCN, NULL)) in populate_sdt_note()
2325 if (elf_section_by_name(*elf, &ehdr, &shdr, SDT_PROBES_SCN, NULL)) in populate_sdt_note()
2354 GElf_Ehdr ehdr; in construct_sdt_notes_list() local
2363 if (gelf_getehdr(elf, &ehdr) == NULL) { in construct_sdt_notes_list()
2373 scn = elf_section_by_name(elf, &ehdr, &shdr, SDT_NOTE_SCN, NULL); in construct_sdt_notes_list()