Changeset View
Changeset View
Standalone View
Standalone View
head/stand/common/load_elf_obj.c
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | __elfN(obj_loadfile)(char *filename, uint64_t dest, | ||||
} | } | ||||
if (hdr->e_shnum * hdr->e_shentsize == 0 || hdr->e_shoff == 0 || | if (hdr->e_shnum * hdr->e_shentsize == 0 || hdr->e_shoff == 0 || | ||||
hdr->e_shentsize != sizeof(Elf_Shdr)) { | hdr->e_shentsize != sizeof(Elf_Shdr)) { | ||||
err = EFTYPE; | err = EFTYPE; | ||||
goto oerr; | goto oerr; | ||||
} | } | ||||
#ifdef LOADER_VERIEXEC | |||||
if (verify_file(ef.fd, filename, bytes_read, VE_MUST) < 0) { | |||||
err = EAUTH; | |||||
goto oerr; | |||||
} | |||||
#endif | |||||
kfp = file_findfile(NULL, __elfN(obj_kerneltype)); | kfp = file_findfile(NULL, __elfN(obj_kerneltype)); | ||||
if (kfp == NULL) { | if (kfp == NULL) { | ||||
printf("elf" __XSTRING(__ELF_WORD_SIZE) | printf("elf" __XSTRING(__ELF_WORD_SIZE) | ||||
"_obj_loadfile: can't load module before kernel\n"); | "_obj_loadfile: can't load module before kernel\n"); | ||||
err = EPERM; | err = EPERM; | ||||
goto oerr; | goto oerr; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 402 Lines • Show Last 20 Lines |