Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/imgact_elf.c
Show First 20 Lines • Show All 1,327 Lines • ▼ Show 20 Lines | __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) | ||||
elf_auxargs->entry = entry; | elf_auxargs->entry = entry; | ||||
elf_auxargs->hdr_eflags = hdr->e_flags; | elf_auxargs->hdr_eflags = hdr->e_flags; | ||||
imgp->auxargs = elf_auxargs; | imgp->auxargs = elf_auxargs; | ||||
imgp->interpreted = 0; | imgp->interpreted = 0; | ||||
imgp->reloc_base = addr; | imgp->reloc_base = addr; | ||||
imgp->proc->p_osrel = osrel; | imgp->proc->p_osrel = osrel; | ||||
imgp->proc->p_fctl0 = fctl0; | imgp->proc->p_fctl0 = fctl0; | ||||
imgp->proc->p_elf_machine = hdr->e_machine; | |||||
imgp->proc->p_elf_flags = hdr->e_flags; | imgp->proc->p_elf_flags = hdr->e_flags; | ||||
ret: | ret: | ||||
if (free_interp) | if (free_interp) | ||||
free(interp, M_TEMP); | free(interp, M_TEMP); | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 456 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
__elfN(puthdr)(struct thread *td, void *hdr, size_t hdrsize, int numsegs, | __elfN(puthdr)(struct thread *td, void *hdr, size_t hdrsize, int numsegs, | ||||
size_t notesz, int flags) | size_t notesz, int flags) | ||||
{ | { | ||||
Elf_Ehdr *ehdr; | Elf_Ehdr *ehdr; | ||||
Elf_Phdr *phdr; | Elf_Phdr *phdr; | ||||
Elf_Shdr *shdr; | Elf_Shdr *shdr; | ||||
struct phdr_closure phc; | struct phdr_closure phc; | ||||
Elf_Brandinfo *bi; | |||||
ehdr = (Elf_Ehdr *)hdr; | ehdr = (Elf_Ehdr *)hdr; | ||||
bi = td->td_proc->p_elf_brandinfo; | |||||
ehdr->e_ident[EI_MAG0] = ELFMAG0; | ehdr->e_ident[EI_MAG0] = ELFMAG0; | ||||
ehdr->e_ident[EI_MAG1] = ELFMAG1; | ehdr->e_ident[EI_MAG1] = ELFMAG1; | ||||
ehdr->e_ident[EI_MAG2] = ELFMAG2; | ehdr->e_ident[EI_MAG2] = ELFMAG2; | ||||
ehdr->e_ident[EI_MAG3] = ELFMAG3; | ehdr->e_ident[EI_MAG3] = ELFMAG3; | ||||
ehdr->e_ident[EI_CLASS] = ELF_CLASS; | ehdr->e_ident[EI_CLASS] = ELF_CLASS; | ||||
ehdr->e_ident[EI_DATA] = ELF_DATA; | ehdr->e_ident[EI_DATA] = ELF_DATA; | ||||
ehdr->e_ident[EI_VERSION] = EV_CURRENT; | ehdr->e_ident[EI_VERSION] = EV_CURRENT; | ||||
ehdr->e_ident[EI_OSABI] = td->td_proc->p_sysent->sv_elf_core_osabi; | ehdr->e_ident[EI_OSABI] = td->td_proc->p_sysent->sv_elf_core_osabi; | ||||
ehdr->e_ident[EI_ABIVERSION] = 0; | ehdr->e_ident[EI_ABIVERSION] = 0; | ||||
ehdr->e_ident[EI_PAD] = 0; | ehdr->e_ident[EI_PAD] = 0; | ||||
ehdr->e_type = ET_CORE; | ehdr->e_type = ET_CORE; | ||||
ehdr->e_machine = td->td_proc->p_elf_machine; | ehdr->e_machine = bi->machine; | ||||
ehdr->e_version = EV_CURRENT; | ehdr->e_version = EV_CURRENT; | ||||
ehdr->e_entry = 0; | ehdr->e_entry = 0; | ||||
ehdr->e_phoff = sizeof(Elf_Ehdr); | ehdr->e_phoff = sizeof(Elf_Ehdr); | ||||
ehdr->e_flags = td->td_proc->p_elf_flags; | ehdr->e_flags = td->td_proc->p_elf_flags; | ||||
ehdr->e_ehsize = sizeof(Elf_Ehdr); | ehdr->e_ehsize = sizeof(Elf_Ehdr); | ||||
ehdr->e_phentsize = sizeof(Elf_Phdr); | ehdr->e_phentsize = sizeof(Elf_Phdr); | ||||
ehdr->e_shentsize = sizeof(Elf_Shdr); | ehdr->e_shentsize = sizeof(Elf_Shdr); | ||||
ehdr->e_shstrndx = SHN_UNDEF; | ehdr->e_shstrndx = SHN_UNDEF; | ||||
▲ Show 20 Lines • Show All 867 Lines • Show Last 20 Lines |