Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/link_elf_obj.c
Show All 28 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include "opt_ddb.h" | #include "opt_ddb.h" | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/fcntl.h> | |||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/linker.h> | |||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/mount.h> | #include <sys/mount.h> | ||||
#include <sys/proc.h> | |||||
#include <sys/namei.h> | #include <sys/namei.h> | ||||
#include <sys/fcntl.h> | #include <sys/proc.h> | ||||
#include <sys/rwlock.h> | |||||
#include <sys/vnode.h> | #include <sys/vnode.h> | ||||
#include <sys/linker.h> | |||||
#include <machine/elf.h> | #include <machine/elf.h> | ||||
#include <net/vnet.h> | #include <net/vnet.h> | ||||
#include <security/mac/mac_framework.h> | #include <security/mac/mac_framework.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_param.h> | #include <vm/vm_param.h> | ||||
#include <vm/vm_object.h> | |||||
#include <vm/vm_kern.h> | |||||
#include <vm/vm_extern.h> | |||||
#include <vm/pmap.h> | #include <vm/pmap.h> | ||||
#include <vm/vm_extern.h> | |||||
#include <vm/vm_kern.h> | |||||
#include <vm/vm_map.h> | #include <vm/vm_map.h> | ||||
#include <vm/vm_object.h> | |||||
#include <vm/vm_page.h> | |||||
#include <vm/vm_pager.h> | |||||
#include <sys/link_elf.h> | #include <sys/link_elf.h> | ||||
#ifdef DDB_CTF | #ifdef DDB_CTF | ||||
#include <contrib/zlib/zlib.h> | #include <contrib/zlib/zlib.h> | ||||
#endif | #endif | ||||
#include "linker_if.h" | #include "linker_if.h" | ||||
▲ Show 20 Lines • Show All 831 Lines • ▼ Show 20 Lines | #endif | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* We know how much space we need for the text/data/bss/etc. | * We know how much space we need for the text/data/bss/etc. | ||||
* This stuff needs to be in a single chunk so that profiling etc | * This stuff needs to be in a single chunk so that profiling etc | ||||
* can get the bounds and gdb can associate offsets with modules | * can get the bounds and gdb can associate offsets with modules | ||||
*/ | */ | ||||
ef->object = vm_object_allocate(OBJT_PHYS, atop(round_page(mapsize))); | ef->object = vm_pager_allocate(OBJT_PHYS, NULL, round_page(mapsize), | ||||
VM_PROT_ALL, 0, thread0.td_ucred); | |||||
if (ef->object == NULL) { | if (ef->object == NULL) { | ||||
error = ENOMEM; | error = ENOMEM; | ||||
goto out; | goto out; | ||||
} | } | ||||
/* | /* | ||||
* In order to satisfy amd64's architectural requirements on the | * In order to satisfy amd64's architectural requirements on the | ||||
* location of code and data in the kernel's address space, request a | * location of code and data in the kernel's address space, request a | ||||
▲ Show 20 Lines • Show All 819 Lines • Show Last 20 Lines |