Lines Matching refs:ehdr
1 static void glue(bswap_ehdr, SZ)(struct elfhdr *ehdr) in glue()
3 bswap16s(&ehdr->e_type); /* Object file type */ in glue()
4 bswap16s(&ehdr->e_machine); /* Architecture */ in glue()
5 bswap32s(&ehdr->e_version); /* Object file version */ in glue()
6 bswapSZs(&ehdr->e_entry); /* Entry point virtual address */ in glue()
7 bswapSZs(&ehdr->e_phoff); /* Program header table file offset */ in glue()
8 bswapSZs(&ehdr->e_shoff); /* Section header table file offset */ in glue()
9 bswap32s(&ehdr->e_flags); /* Processor-specific flags */ in glue()
10 bswap16s(&ehdr->e_ehsize); /* ELF header size in bytes */ in glue()
11 bswap16s(&ehdr->e_phentsize); /* Program header table entry size */ in glue()
12 bswap16s(&ehdr->e_phnum); /* Program header table entry count */ in glue()
13 bswap16s(&ehdr->e_shentsize); /* Section header table entry size */ in glue()
14 bswap16s(&ehdr->e_shnum); /* Section header table entry count */ in glue()
15 bswap16s(&ehdr->e_shstrndx); /* Section header string table index */ in glue()
101 static int glue(load_symbols, SZ)(struct elfhdr *ehdr, int fd, int must_swab) in glue()
109 shdr_table = load_at(fd, ehdr->e_shoff, in glue()
110 sizeof(struct elf_shdr) * ehdr->e_shnum); in glue()
115 for (i = 0; i < ehdr->e_shnum; i++) { in glue()
120 symtab = glue(find_section, SZ)(shdr_table, ehdr->e_shnum, SHT_SYMTAB); in glue()
155 if (symtab->sh_link >= ehdr->e_shnum) in glue()
184 struct elfhdr ehdr; in glue() local
191 if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr)) in glue()
194 glue(bswap_ehdr, SZ)(&ehdr); in glue()
199 if (EM_PPC64 != ehdr.e_machine) in glue()
200 if (EM_PPC != ehdr.e_machine) in glue()
204 if (EM_X86_64 != ehdr.e_machine) in glue()
205 if (EM_386 != ehdr.e_machine) in glue()
209 if (ELF_MACHINE != ehdr.e_machine) in glue()
214 *pentry = (uint64_t)(elf_sword)ehdr.e_entry; in glue()
216 glue(load_symbols, SZ)(&ehdr, fd, must_swab); in glue()
218 size = ehdr.e_phnum * sizeof(phdr[0]); in glue()
219 lseek(fd, ehdr.e_phoff, SEEK_SET); in glue()
226 for(i = 0; i < ehdr.e_phnum; i++) { in glue()
233 for(i = 0; i < ehdr.e_phnum; i++) { in glue()