Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/link_elf.c
Show First 20 Lines • Show All 1,123 Lines • ▼ Show 20 Lines | error = vm_map_find(kernel_map, ef->object, 0, | ||||
(vm_offset_t *)&mapbase, mapsize, 0, VMFS_OPTIMAL_SPACE, | (vm_offset_t *)&mapbase, mapsize, 0, VMFS_OPTIMAL_SPACE, | ||||
VM_PROT_ALL, VM_PROT_ALL, 0); | VM_PROT_ALL, VM_PROT_ALL, 0); | ||||
if (error != 0) { | if (error != 0) { | ||||
vm_object_deallocate(ef->object); | vm_object_deallocate(ef->object); | ||||
ef->object = NULL; | ef->object = NULL; | ||||
goto out; | goto out; | ||||
} | } | ||||
#else | #else | ||||
mapbase = malloc(mapsize, M_LINKER, M_EXEC | M_WAITOK); | mapbase = malloc_exec(mapsize, M_LINKER, M_WAITOK); | ||||
#endif | #endif | ||||
ef->address = mapbase; | ef->address = mapbase; | ||||
/* | /* | ||||
* Read the text and data sections and zero the bss. | * Read the text and data sections and zero the bss. | ||||
*/ | */ | ||||
for (i = 0; i < nsegs; i++) { | for (i = 0; i < nsegs; i++) { | ||||
segbase = mapbase + segs[i]->p_vaddr - base_vaddr; | segbase = mapbase + segs[i]->p_vaddr - base_vaddr; | ||||
▲ Show 20 Lines • Show All 802 Lines • Show Last 20 Lines |