Home | History | Annotate | Download | only in qemu

Lines Matching refs:ehdr

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