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