Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/link_elf.c
Show First 20 Lines • Show All 763 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Apply the specified protection to the loadable segments of a preloaded linker | * Apply the specified protection to the loadable segments of a preloaded linker | ||||
* file. | * file. | ||||
*/ | */ | ||||
static int | static int | ||||
preload_protect(elf_file_t ef, vm_prot_t prot) | preload_protect(elf_file_t ef, vm_prot_t prot) | ||||
{ | { | ||||
#ifdef __amd64__ | #if defined(__aarch64__) || defined(__amd64__) | ||||
Elf_Ehdr *hdr; | Elf_Ehdr *hdr; | ||||
Elf_Phdr *phdr, *phlimit; | Elf_Phdr *phdr, *phlimit; | ||||
vm_prot_t nprot; | vm_prot_t nprot; | ||||
int error; | int error; | ||||
error = 0; | error = 0; | ||||
hdr = (Elf_Ehdr *)ef->address; | hdr = (Elf_Ehdr *)ef->address; | ||||
phdr = (Elf_Phdr *)(ef->address + hdr->e_phoff); | phdr = (Elf_Phdr *)(ef->address + hdr->e_phoff); | ||||
▲ Show 20 Lines • Show All 1,162 Lines • Show Last 20 Lines |