Lines Matching defs:ehdr

70 	GElf_Ehdr *ehdr;
72 ehdr = gelf_getehdr(elf, &gehdr);
73 if (!ehdr)
76 *dst = ehdr->e_phnum;
229 GElf_Ehdr ehdr;
241 if (gelf_getehdr(elf, &ehdr) == NULL)
244 found = !!elf_section_by_name(elf, &ehdr, &shdr, sec, NULL);
396 static bool addend_may_be_ifunc(GElf_Ehdr *ehdr, struct rel_info *ri)
398 return ehdr->e_machine == EM_X86_64 && ri->is_rela &&
402 static bool get_ifunc_name(Elf *elf, struct dso *dso, GElf_Ehdr *ehdr,
409 if (!addend_may_be_ifunc(ehdr, ri))
433 static bool get_plt_sizes(struct dso *dso, GElf_Ehdr *ehdr, GElf_Shdr *shdr_plt,
436 switch (ehdr->e_machine) {
538 static void get_rela_dyn_info(Elf *elf, GElf_Ehdr *ehdr, struct rela_dyn_info *di, Elf_Scn *scn)
545 scn = elf_section_by_name(elf, ehdr, &rela_dyn_shdr, ".rela.dyn", NULL);
633 GElf_Ehdr *ehdr,
643 scn = elf_section_by_name(elf, ehdr, &shdr, ".plt.got", NULL);
647 if (ehdr->e_machine == EM_X86_64)
648 get_rela_dyn_info(elf, ehdr, &di, scn);
681 GElf_Ehdr ehdr;
689 ehdr = ss->ehdr;
691 if (!elf_section_by_name(elf, &ehdr, &shdr_plt, ".plt", NULL))
703 if (!get_plt_sizes(dso, &ehdr, &shdr_plt, &plt_header_size, &plt_entry_size))
713 if (machine_is_x86(ehdr.e_machine) &&
714 dso__synthesize_plt_got_symbols(dso, elf, &ehdr, sympltname, sizeof(sympltname)))
718 if (machine_is_x86(ehdr.e_machine) &&
719 elf_section_by_name(elf, &ehdr, &plt_sec_shdr, ".plt.sec", NULL)) {
720 if (!get_plt_sizes(dso, &ehdr, &plt_sec_shdr, &plt_header_size, &plt_entry_size))
732 scn_plt_rel = elf_section_by_name(elf, &ehdr, &shdr_rel_plt,
735 scn_plt_rel = elf_section_by_name(elf, &ehdr, &shdr_rel_plt,
807 if (machine_is_x86(ehdr.e_machine) && sort_rel(&ri))
822 else if (!get_ifunc_name(elf, dso, &ehdr, &ri, sympltname, sizeof(sympltname)))
859 GElf_Ehdr ehdr;
873 if (gelf_getehdr(elf, &ehdr) == NULL) {
885 sec = elf_section_by_name(elf, &ehdr, &shdr,
890 sec = elf_section_by_name(elf, &ehdr, &shdr,
895 sec = elf_section_by_name(elf, &ehdr, &shdr,
1124 GElf_Ehdr ehdr;
1144 if (gelf_getehdr(elf, &ehdr) == NULL) {
1149 sec = elf_section_by_name(elf, &ehdr, &shdr,
1217 bool elf__needs_adjust_symbols(GElf_Ehdr ehdr)
1224 return ehdr.e_type == ET_EXEC || ehdr.e_type == ET_REL ||
1225 ehdr.e_type == ET_DYN;
1231 GElf_Ehdr ehdr;
1256 if (gelf_getehdr(elf, &ehdr) == NULL) {
1262 if (dso__swap_init(dso, ehdr.e_ident[EI_DATA])) {
1290 ss->symtab = elf_section_by_name(elf, &ehdr, &ss->symshdr, ".symtab",
1296 ss->dynsym = elf_section_by_name(elf, &ehdr, &ss->dynshdr, ".dynsym",
1302 ss->opdsec = elf_section_by_name(elf, &ehdr, &ss->opdshdr, ".opd",
1310 ss->adjust_symbols = elf__needs_adjust_symbols(ehdr);
1320 ss->ehdr = ehdr;
1493 GElf_Ehdr ehdr;
1507 ehdr = syms_ss->ehdr;
1516 if (elf_section_by_name(runtime_ss->elf, &runtime_ss->ehdr, &tshdr,
1535 sec_strndx = elf_getscn(runtime_ss->elf, runtime_ss->ehdr.e_shstrndx);
1543 sec_strndx = elf_getscn(elf, ehdr.e_shstrndx);
1601 if (ehdr.e_machine == EM_ARM || ehdr.e_machine == EM_AARCH64) {
1669 if ((ehdr.e_machine == EM_ARM) &&
1753 dso->rel = syms_ss->ehdr.e_type == ET_REL;
1843 GElf_Ehdr ehdr;
1860 if (gelf_getehdr(elf, &ehdr) == NULL)
1863 if (ehdr.e_machine == EM_X86_64)
1918 GElf_Ehdr ehdr;
1923 GElf_Ehdr *ehdr;
1937 ehdr = gelf_getehdr(kcore->elf, &kcore->ehdr);
1938 if (!ehdr)
1969 memset(&kcore->ehdr, 0, sizeof(GElf_Ehdr));
1989 GElf_Ehdr *ehdr = &to->ehdr;
1990 GElf_Ehdr *kehdr = &from->ehdr;
1992 memcpy(ehdr->e_ident, kehdr->e_ident, EI_NIDENT);
1993 ehdr->e_type = kehdr->e_type;
1994 ehdr->e_machine = kehdr->e_machine;
1995 ehdr->e_version = kehdr->e_version;
1996 ehdr->e_entry = 0;
1997 ehdr->e_shoff = 0;
1998 ehdr->e_flags = kehdr->e_flags;
1999 ehdr->e_phnum = count;
2000 ehdr->e_shentsize = 0;
2001 ehdr->e_shnum = 0;
2002 ehdr->e_shstrndx = 0;
2005 ehdr->e_phoff = sizeof(Elf32_Ehdr);
2006 ehdr->e_ehsize = sizeof(Elf32_Ehdr);
2007 ehdr->e_phentsize = sizeof(Elf32_Phdr);
2009 ehdr->e_phoff = sizeof(Elf64_Ehdr);
2010 ehdr->e_ehsize = sizeof(Elf64_Ehdr);
2011 ehdr->e_phentsize = sizeof(Elf64_Phdr);
2014 if (!gelf_update_ehdr(to->elf, ehdr))
2659 GElf_Ehdr ehdr;
2742 if (!gelf_getehdr(*elf, &ehdr)) {
2755 if (elf_section_by_name(*elf, &ehdr, &shdr, SDT_BASE_SCN, NULL))
2759 if (elf_section_by_name(*elf, &ehdr, &shdr, SDT_PROBES_SCN, NULL))
2788 GElf_Ehdr ehdr;
2797 if (gelf_getehdr(elf, &ehdr) == NULL) {
2807 scn = elf_section_by_name(elf, &ehdr, &shdr, SDT_NOTE_SCN, NULL);