Lines Matching refs:ehdr
13 static Elf_Ehdr ehdr; variable
241 sec_strtab = secs[ehdr.e_shstrndx].strtab; in sec_name()
243 if (shndx < ehdr.e_shnum) { in sec_name()
271 for (i = 0; i < ehdr.e_shnum; i++) { in sym_lookup()
335 if (fread(&ehdr, sizeof(ehdr), 1, fp) != 1) { in read_ehdr()
339 if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0) { in read_ehdr()
342 if (ehdr.e_ident[EI_CLASS] != ELF_CLASS) { in read_ehdr()
345 if (ehdr.e_ident[EI_DATA] != ELFDATA2LSB) { in read_ehdr()
348 if (ehdr.e_ident[EI_VERSION] != EV_CURRENT) { in read_ehdr()
352 ehdr.e_type = elf_half_to_cpu(ehdr.e_type); in read_ehdr()
353 ehdr.e_machine = elf_half_to_cpu(ehdr.e_machine); in read_ehdr()
354 ehdr.e_version = elf_word_to_cpu(ehdr.e_version); in read_ehdr()
355 ehdr.e_entry = elf_addr_to_cpu(ehdr.e_entry); in read_ehdr()
356 ehdr.e_phoff = elf_off_to_cpu(ehdr.e_phoff); in read_ehdr()
357 ehdr.e_shoff = elf_off_to_cpu(ehdr.e_shoff); in read_ehdr()
358 ehdr.e_flags = elf_word_to_cpu(ehdr.e_flags); in read_ehdr()
359 ehdr.e_ehsize = elf_half_to_cpu(ehdr.e_ehsize); in read_ehdr()
360 ehdr.e_phentsize = elf_half_to_cpu(ehdr.e_phentsize); in read_ehdr()
361 ehdr.e_phnum = elf_half_to_cpu(ehdr.e_phnum); in read_ehdr()
362 ehdr.e_shentsize = elf_half_to_cpu(ehdr.e_shentsize); in read_ehdr()
363 ehdr.e_shnum = elf_half_to_cpu(ehdr.e_shnum); in read_ehdr()
364 ehdr.e_shstrndx = elf_half_to_cpu(ehdr.e_shstrndx); in read_ehdr()
366 if ((ehdr.e_type != ET_EXEC) && (ehdr.e_type != ET_DYN)) { in read_ehdr()
369 if (ehdr.e_machine != ELF_MACHINE) { in read_ehdr()
372 if (ehdr.e_version != EV_CURRENT) { in read_ehdr()
375 if (ehdr.e_ehsize != sizeof(Elf_Ehdr)) { in read_ehdr()
378 if (ehdr.e_phentsize != sizeof(Elf_Phdr)) { in read_ehdr()
381 if (ehdr.e_shentsize != sizeof(Elf_Shdr)) { in read_ehdr()
384 if (ehdr.e_shstrndx >= ehdr.e_shnum) { in read_ehdr()
394 secs = calloc(ehdr.e_shnum, sizeof(struct section)); in read_shdrs()
397 ehdr.e_shnum); in read_shdrs()
399 if (fseek(fp, ehdr.e_shoff, SEEK_SET) < 0) { in read_shdrs()
401 ehdr.e_shoff, strerror(errno)); in read_shdrs()
403 for (i = 0; i < ehdr.e_shnum; i++) { in read_shdrs()
407 i, ehdr.e_shnum, strerror(errno)); in read_shdrs()
418 if (sec->shdr.sh_link < ehdr.e_shnum) in read_shdrs()
427 for (i = 0; i < ehdr.e_shnum; i++) { in read_strtabs()
452 for (i = 0; i < ehdr.e_shnum; i++) { in read_symtabs()
485 for (i = 0; i < ehdr.e_shnum; i++) { in read_relocs()
528 for (i = 0; i < ehdr.e_shnum; i++) { in print_absolute_symbols()
566 for (i = 0; i < ehdr.e_shnum; i++) { in print_absolute_relocs()
650 for (i = 0; i < ehdr.e_shnum; i++) { in walk_relocs()
706 for (i = 0; i < ehdr.e_shnum; i++) { in percpu_init()