Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/linux/imgact_linux.c
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | if (aresid != 0) { | ||||
error = ENOEXEC; | error = ENOEXEC; | ||||
goto fail; | goto fail; | ||||
} | } | ||||
/* | /* | ||||
* remove write enable on the 'text' part | * remove write enable on the 'text' part | ||||
*/ | */ | ||||
error = vm_map_protect(&vmspace->vm_map, vmaddr, | error = vm_map_protect(&vmspace->vm_map, vmaddr, | ||||
vmaddr + a_out->a_text, VM_PROT_EXECUTE|VM_PROT_READ, TRUE); | vmaddr + a_out->a_text, 0, VM_PROT_EXECUTE | VM_PROT_READ, | ||||
VM_MAP_PROTECT_SET_MAXPROT); | |||||
if (error) | if (error) | ||||
goto fail; | goto fail; | ||||
} else { | } else { | ||||
#ifdef DEBUG | #ifdef DEBUG | ||||
printf("imgact: Page aligned binary %lu\n", file_offset); | printf("imgact: Page aligned binary %lu\n", file_offset); | ||||
#endif | #endif | ||||
/* | /* | ||||
* Map text+data read/execute | * Map text+data read/execute | ||||
Show All 10 Lines | #ifdef DEBUG | ||||
printf("imgact: startaddr=%08lx, length=%08lx\n", | printf("imgact: startaddr=%08lx, length=%08lx\n", | ||||
(u_long)vmaddr, | (u_long)vmaddr, | ||||
(u_long)a_out->a_text + (u_long)a_out->a_data); | (u_long)a_out->a_text + (u_long)a_out->a_data); | ||||
#endif | #endif | ||||
/* | /* | ||||
* allow read/write of data | * allow read/write of data | ||||
*/ | */ | ||||
error = vm_map_protect(&vmspace->vm_map, vmaddr + a_out->a_text, | error = vm_map_protect(&vmspace->vm_map, vmaddr + a_out->a_text, | ||||
vmaddr + a_out->a_text + a_out->a_data, VM_PROT_ALL, FALSE); | vmaddr + a_out->a_text + a_out->a_data, VM_PROT_ALL, 0, | ||||
VM_MAP_PROTECT_SET_PROT); | |||||
if (error) | if (error) | ||||
goto fail; | goto fail; | ||||
/* | /* | ||||
* Allocate anon demand-zeroed area for uninitialized data | * Allocate anon demand-zeroed area for uninitialized data | ||||
*/ | */ | ||||
if (bss_size != 0) { | if (bss_size != 0) { | ||||
vmaddr = virtual_offset + a_out->a_text + a_out->a_data; | vmaddr = virtual_offset + a_out->a_text + a_out->a_data; | ||||
Show All 33 Lines |