Lines Matching defs:ehdr
104 Elf32_Ehdr ehdr;
108 if (read_ehdr32(P, &ehdr, &phnum, ehdr_start) != 0)
112 a = ehdr_start + ehdr.e_phoff;
113 for (i = 0; i < phnum; i++, a += ehdr.e_phentsize) {
123 if (ehdr.e_type == ET_DYN)
132 Elf64_Ehdr ehdr;
136 if (read_ehdr64(P, &ehdr, &phnum, ehdr_start) != 0)
140 a = ehdr_start + ehdr.e_phoff;
141 for (i = 0; i < phnum; i++, a += ehdr.e_phentsize) {
151 if (ehdr.e_type == ET_DYN)
1017 read_ehdr32(struct ps_prochandle *P, Elf32_Ehdr *ehdr, uint_t *phnum,
1020 if (Pread(P, ehdr, sizeof (*ehdr), addr) != sizeof (*ehdr))
1023 if (ehdr->e_ident[EI_MAG0] != ELFMAG0 ||
1024 ehdr->e_ident[EI_MAG1] != ELFMAG1 ||
1025 ehdr->e_ident[EI_MAG2] != ELFMAG2 ||
1026 ehdr->e_ident[EI_MAG3] != ELFMAG3 ||
1027 ehdr->e_ident[EI_CLASS] != ELFCLASS32 ||
1029 ehdr->e_ident[EI_DATA] != ELFDATA2MSB ||
1031 ehdr->e_ident[EI_DATA] != ELFDATA2LSB ||
1033 ehdr->e_ident[EI_VERSION] != EV_CURRENT)
1036 if ((*phnum = ehdr->e_phnum) == PN_XNUM) {
1039 if (ehdr->e_shoff == 0 || ehdr->e_shentsize < sizeof (shdr0) ||
1040 Pread(P, &shdr0, sizeof (shdr0), addr + ehdr->e_shoff) !=
1052 read_dynamic_phdr32(struct ps_prochandle *P, const Elf32_Ehdr *ehdr,
1058 uintptr_t a = addr + ehdr->e_phoff + i * ehdr->e_phentsize;
1071 read_ehdr64(struct ps_prochandle *P, Elf64_Ehdr *ehdr, uint_t *phnum,
1074 if (Pread(P, ehdr, sizeof (Elf64_Ehdr), addr) != sizeof (Elf64_Ehdr))
1077 if (ehdr->e_ident[EI_MAG0] != ELFMAG0 ||
1078 ehdr->e_ident[EI_MAG1] != ELFMAG1 ||
1079 ehdr->e_ident[EI_MAG2] != ELFMAG2 ||
1080 ehdr->e_ident[EI_MAG3] != ELFMAG3 ||
1081 ehdr->e_ident[EI_CLASS] != ELFCLASS64 ||
1083 ehdr->e_ident[EI_DATA] != ELFDATA2MSB ||
1085 ehdr->e_ident[EI_DATA] != ELFDATA2LSB ||
1087 ehdr->e_ident[EI_VERSION] != EV_CURRENT)
1090 if ((*phnum = ehdr->e_phnum) == PN_XNUM) {
1093 if (ehdr->e_shoff == 0 || ehdr->e_shentsize < sizeof (shdr0) ||
1094 Pread(P, &shdr0, sizeof (shdr0), addr + ehdr->e_shoff) !=
1106 read_dynamic_phdr64(struct ps_prochandle *P, const Elf64_Ehdr *ehdr,
1112 uintptr_t a = addr + ehdr->e_phoff + i * ehdr->e_phentsize;
1223 Elf32_Ehdr ehdr;
1228 if (read_ehdr32(P, &ehdr, &phnum, addr) != 0 ||
1229 read_dynamic_phdr32(P, &ehdr, phnum, &phdr, addr) != 0)
1232 if (ehdr.e_type == ET_DYN)
1258 Elf64_Ehdr ehdr;
1263 if (read_ehdr64(P, &ehdr, &phnum, addr) != 0 ||
1264 read_dynamic_phdr64(P, &ehdr, phnum, &phdr, addr) != 0)
1267 if (ehdr.e_type == ET_DYN)
1319 Elf32_Ehdr ehdr;
1322 if ((read_ehdr32(P, &ehdr, &phnum, addr) != 0) ||
1323 read_dynamic_phdr32(P, &ehdr, phnum, &phdr, addr) != 0)
1326 elf = fake_elf32(P, fptr, addr, &ehdr, phnum, &phdr);
1329 Elf64_Ehdr ehdr;
1332 if (read_ehdr64(P, &ehdr, &phnum, addr) != 0 ||
1333 read_dynamic_phdr64(P, &ehdr, phnum, &phdr, addr) != 0)
1336 elf = fake_elf64(P, fptr, addr, &ehdr, phnum, &phdr);
1546 build_fake_elf(struct ps_prochandle *P, file_info_t *fptr, GElf_Ehdr *ehdr,
1555 gelf_getehdr(elf, ehdr) == NULL ||
1578 GElf_Ehdr ehdr;
1644 if ((elf = build_fake_elf(P, fptr, &ehdr, &nshdrs, &shdata)) ==
1652 if ((elf = build_fake_elf(P, fptr, &ehdr, &nshdrs, &shdata)) ==
1658 gelf_getehdr(elf, &ehdr) == NULL ||
1669 if ((elf = build_fake_elf(P, fptr, &ehdr, &nshdrs, &shdata)) ==
1686 if ((newelf = build_fake_elf(P, fptr, &ehdr, &nshdrs, &shdata))
1715 fptr->file_class = ehdr.e_ident[EI_CLASS];
1716 fptr->file_etype = ehdr.e_type;