Lines Matching refs:ehdr
454 static void *ehdr_init(Elf64_Ehdr *ehdr, int mem_chunk_cnt)
456 memset(ehdr, 0, sizeof(*ehdr));
457 memcpy(ehdr->e_ident, ELFMAG, SELFMAG);
458 ehdr->e_ident[EI_CLASS] = ELFCLASS64;
459 ehdr->e_ident[EI_DATA] = ELFDATA2MSB;
460 ehdr->e_ident[EI_VERSION] = EV_CURRENT;
461 memset(ehdr->e_ident + EI_PAD, 0, EI_NIDENT - EI_PAD);
462 ehdr->e_type = ET_CORE;
463 ehdr->e_machine = EM_S390;
464 ehdr->e_version = EV_CURRENT;
465 ehdr->e_phoff = sizeof(Elf64_Ehdr);
466 ehdr->e_ehsize = sizeof(Elf64_Ehdr);
467 ehdr->e_phentsize = sizeof(Elf64_Phdr);
472 ehdr->e_phnum = mem_chunk_cnt + 1 + 1;
473 return ehdr + 1;