Lines Matching refs:elf_file

62 	(lseek64(fd, (off64_t)elf_file.shdr[(index)].sh_offset, SEEK_SET) != \
63 (off64_t)elf_file.shdr[(index)].sh_offset || \
64 dt_write(dtp, fd, (data), elf_file.shdr[(index)].sh_size) != \
65 elf_file.shdr[(index)].sh_size)
458 } elf_file;
475 bzero(&elf_file, sizeof (elf_file));
477 elf_file.ehdr.e_ident[EI_MAG0] = ELFMAG0;
478 elf_file.ehdr.e_ident[EI_MAG1] = ELFMAG1;
479 elf_file.ehdr.e_ident[EI_MAG2] = ELFMAG2;
480 elf_file.ehdr.e_ident[EI_MAG3] = ELFMAG3;
481 elf_file.ehdr.e_ident[EI_VERSION] = EV_CURRENT;
482 elf_file.ehdr.e_ident[EI_CLASS] = ELFCLASS32;
484 elf_file.ehdr.e_ident[EI_DATA] = ELFDATA2MSB;
486 elf_file.ehdr.e_ident[EI_DATA] = ELFDATA2LSB;
488 elf_file.ehdr.e_type = ET_REL;
490 elf_file.ehdr.e_machine = EM_SPARC;
492 elf_file.ehdr.e_machine = EM_386;
494 elf_file.ehdr.e_version = EV_CURRENT;
495 elf_file.ehdr.e_shoff = sizeof (Elf32_Ehdr);
496 elf_file.ehdr.e_ehsize = sizeof (Elf32_Ehdr);
497 elf_file.ehdr.e_phentsize = sizeof (Elf32_Phdr);
498 elf_file.ehdr.e_shentsize = sizeof (Elf32_Shdr);
499 elf_file.ehdr.e_shnum = nshdr;
500 elf_file.ehdr.e_shstrndx = ESHDR_SHSTRTAB;
501 off = sizeof (elf_file) + nshdr * sizeof (Elf32_Shdr);
503 shp = &elf_file.shdr[ESHDR_SHSTRTAB];
511 shp = &elf_file.shdr[ESHDR_DOF];
520 shp = &elf_file.shdr[ESHDR_STRTAB];
529 shp = &elf_file.shdr[ESHDR_SYMTAB];
542 if (dt_write(dtp, fd, &elf_file,
543 sizeof (elf_file)) != sizeof (elf_file) ||
551 shp = &elf_file.shdr[ESHDR_REL];
566 if (dt_write(dtp, fd, &elf_file,
567 sizeof (elf_file)) != sizeof (elf_file) ||
595 } elf_file;
612 bzero(&elf_file, sizeof (elf_file));
614 elf_file.ehdr.e_ident[EI_MAG0] = ELFMAG0;
615 elf_file.ehdr.e_ident[EI_MAG1] = ELFMAG1;
616 elf_file.ehdr.e_ident[EI_MAG2] = ELFMAG2;
617 elf_file.ehdr.e_ident[EI_MAG3] = ELFMAG3;
618 elf_file.ehdr.e_ident[EI_VERSION] = EV_CURRENT;
619 elf_file.ehdr.e_ident[EI_CLASS] = ELFCLASS64;
621 elf_file.ehdr.e_ident[EI_DATA] = ELFDATA2MSB;
623 elf_file.ehdr.e_ident[EI_DATA] = ELFDATA2LSB;
625 elf_file.ehdr.e_type = ET_REL;
627 elf_file.ehdr.e_machine = EM_SPARCV9;
629 elf_file.ehdr.e_machine = EM_AMD64;
631 elf_file.ehdr.e_version = EV_CURRENT;
632 elf_file.ehdr.e_shoff = sizeof (Elf64_Ehdr);
633 elf_file.ehdr.e_ehsize = sizeof (Elf64_Ehdr);
634 elf_file.ehdr.e_phentsize = sizeof (Elf64_Phdr);
635 elf_file.ehdr.e_shentsize = sizeof (Elf64_Shdr);
636 elf_file.ehdr.e_shnum = nshdr;
637 elf_file.ehdr.e_shstrndx = ESHDR_SHSTRTAB;
638 off = sizeof (elf_file) + nshdr * sizeof (Elf64_Shdr);
640 shp = &elf_file.shdr[ESHDR_SHSTRTAB];
648 shp = &elf_file.shdr[ESHDR_DOF];
657 shp = &elf_file.shdr[ESHDR_STRTAB];
666 shp = &elf_file.shdr[ESHDR_SYMTAB];
679 if (dt_write(dtp, fd, &elf_file,
680 sizeof (elf_file)) != sizeof (elf_file) ||
688 shp = &elf_file.shdr[ESHDR_REL];
699 if (dt_write(dtp, fd, &elf_file,
700 sizeof (elf_file)) != sizeof (elf_file) ||