Lines Matching refs:e_ident
75 get_shnum (void *map_address, unsigned char *e_ident, int fildes, off_t offset, in get_shnum() argument
90 bool is32 = e_ident[EI_CLASS] == ELFCLASS32; in get_shnum()
93 if (e_ident[EI_DATA] == MY_ELFDATA in get_shnum()
95 || (((size_t) e_ident in get_shnum()
98 ehdr.p = e_ident; in get_shnum()
110 ehdr_mem.e32.e_shnum = ((Elf32_Ehdr *) e_ident)->e_shnum; in get_shnum()
111 ehdr_mem.e32.e_shoff = ((Elf32_Ehdr *) e_ident)->e_shoff; in get_shnum()
114 memcpy (&ehdr_mem, e_ident, sizeof (Elf32_Ehdr)); in get_shnum()
116 if (e_ident[EI_DATA] != MY_ELFDATA) in get_shnum()
126 ehdr_mem.e64.e_shnum = ((Elf64_Ehdr *) e_ident)->e_shnum; in get_shnum()
127 ehdr_mem.e64.e_shoff = ((Elf64_Ehdr *) e_ident)->e_shoff; in get_shnum()
130 memcpy (&ehdr_mem, e_ident, sizeof (Elf64_Ehdr)); in get_shnum()
132 if (e_ident[EI_DATA] != MY_ELFDATA) in get_shnum()
152 if (likely (map_address != NULL) && e_ident[EI_DATA] == MY_ELFDATA in get_shnum()
177 if (e_ident[EI_DATA] != MY_ELFDATA) in get_shnum()
202 if (likely (map_address != NULL) && e_ident[EI_DATA] == MY_ELFDATA in get_shnum()
225 if (e_ident[EI_DATA] != MY_ELFDATA) in get_shnum()
248 file_read_elf (int fildes, void *map_address, unsigned char *e_ident, in file_read_elf() argument
252 if (unlikely ((e_ident[EI_CLASS] != ELFCLASS32 in file_read_elf()
253 && e_ident[EI_CLASS] != ELFCLASS64) in file_read_elf()
255 || (e_ident[EI_DATA] != ELFDATA2LSB in file_read_elf()
256 && e_ident[EI_DATA] != ELFDATA2MSB))) in file_read_elf()
264 size_t scncnt = get_shnum (map_address, e_ident, fildes, offset, maxsize); in file_read_elf()
270 if (e_ident[EI_CLASS] == ELFCLASS32) in file_read_elf()
298 elf->class = e_ident[EI_CLASS]; in file_read_elf()
300 if (e_ident[EI_CLASS] == ELFCLASS32) in file_read_elf()
307 if (map_address != NULL && e_ident[EI_DATA] == MY_ELFDATA in file_read_elf()
365 elf->state.elf32.ehdr = memcpy (&elf->state.elf32.ehdr_mem, e_ident, in file_read_elf()
368 if (e_ident[EI_DATA] != MY_ELFDATA) in file_read_elf()
403 if (map_address != NULL && e_ident[EI_DATA] == MY_ELFDATA in file_read_elf()
456 elf->state.elf64.ehdr = memcpy (&elf->state.elf64.ehdr_mem, e_ident, in file_read_elf()
459 if (e_ident[EI_DATA] != MY_ELFDATA) in file_read_elf()
501 unsigned char *e_ident = (unsigned char *) map_address + offset; in __libelf_read_mmaped_file() local
504 Elf_Kind kind = determine_kind (e_ident, maxsize); in __libelf_read_mmaped_file()
509 return file_read_elf (fildes, map_address, e_ident, offset, maxsize, in __libelf_read_mmaped_file()