Lines Matching refs:ehdr
471 Elf_Ehdr *ehdr, binhdr; in elf_puthdr() local
483 ehdr = (Elf_Ehdr *)hdr; in elf_puthdr()
485 ehdr->e_ident[EI_MAG0] = ELFMAG0; in elf_puthdr()
486 ehdr->e_ident[EI_MAG1] = ELFMAG1; in elf_puthdr()
487 ehdr->e_ident[EI_MAG2] = ELFMAG2; in elf_puthdr()
488 ehdr->e_ident[EI_MAG3] = ELFMAG3; in elf_puthdr()
489 ehdr->e_ident[EI_CLASS] = ELF_CLASS; in elf_puthdr()
490 ehdr->e_ident[EI_DATA] = ELF_DATA; in elf_puthdr()
491 ehdr->e_ident[EI_VERSION] = EV_CURRENT; in elf_puthdr()
492 ehdr->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; in elf_puthdr()
493 ehdr->e_ident[EI_ABIVERSION] = 0; in elf_puthdr()
494 ehdr->e_ident[EI_PAD] = 0; in elf_puthdr()
495 ehdr->e_type = ET_CORE; in elf_puthdr()
496 ehdr->e_machine = binhdr.e_machine; in elf_puthdr()
497 ehdr->e_version = EV_CURRENT; in elf_puthdr()
498 ehdr->e_entry = 0; in elf_puthdr()
499 ehdr->e_phoff = sizeof(Elf_Ehdr); in elf_puthdr()
500 ehdr->e_flags = binhdr.e_flags; in elf_puthdr()
501 ehdr->e_ehsize = sizeof(Elf_Ehdr); in elf_puthdr()
502 ehdr->e_phentsize = sizeof(Elf_Phdr); in elf_puthdr()
503 ehdr->e_shentsize = sizeof(Elf_Shdr); in elf_puthdr()
504 ehdr->e_shstrndx = SHN_UNDEF; in elf_puthdr()
506 ehdr->e_phnum = numsegs + 1; in elf_puthdr()
507 ehdr->e_shnum = 0; in elf_puthdr()
509 ehdr->e_phnum = PN_XNUM; in elf_puthdr()
510 ehdr->e_shnum = 1; in elf_puthdr()
512 ehdr->e_shoff = ehdr->e_phoff + in elf_puthdr()
513 (numsegs + 1) * ehdr->e_phentsize; in elf_puthdr()
515 shdr = (Elf_Shdr *)((char *)hdr + ehdr->e_shoff); in elf_puthdr()
528 shdr->sh_size = ehdr->e_shnum; in elf_puthdr()
529 shdr->sh_link = ehdr->e_shstrndx; in elf_puthdr()
536 phdr = (Elf_Phdr *)((char *)hdr + ehdr->e_phoff); in elf_puthdr()