summaryrefslogtreecommitdiffstats
path: root/sys/kern/link_elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r--sys/kern/link_elf.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index 5044ceb..fe4aba3 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -517,7 +517,6 @@ link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* resu
{
struct nameidata nd;
struct thread* td = curthread; /* XXX */
- struct proc* p = td->td_proc; /* XXX */
Elf_Ehdr *hdr;
caddr_t firstpage;
int nbytes, i;
@@ -567,7 +566,7 @@ link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* resu
}
hdr = (Elf_Ehdr *)firstpage;
error = vn_rdwr(UIO_READ, nd.ni_vp, firstpage, PAGE_SIZE, 0,
- UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td);
+ UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, &resid, td);
nbytes = PAGE_SIZE - resid;
if (error)
goto out;
@@ -706,7 +705,7 @@ link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* resu
caddr_t segbase = mapbase + segs[i]->p_vaddr - base_vaddr;
error = vn_rdwr(UIO_READ, nd.ni_vp,
segbase, segs[i]->p_filesz, segs[i]->p_offset,
- UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td);
+ UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, &resid, td);
if (error) {
goto out;
}
@@ -766,7 +765,7 @@ link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* resu
}
error = vn_rdwr(UIO_READ, nd.ni_vp,
(caddr_t)shdr, nbytes, hdr->e_shoff,
- UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td);
+ UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, &resid, td);
if (error)
goto out;
symtabindex = -1;
@@ -791,12 +790,12 @@ link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* resu
}
error = vn_rdwr(UIO_READ, nd.ni_vp,
ef->symbase, symcnt, shdr[symtabindex].sh_offset,
- UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td);
+ UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, &resid, td);
if (error)
goto out;
error = vn_rdwr(UIO_READ, nd.ni_vp,
ef->strbase, strcnt, shdr[symstrindex].sh_offset,
- UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td);
+ UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, &resid, td);
if (error)
goto out;
@@ -828,7 +827,7 @@ out:
if (firstpage)
free(firstpage, M_LINKER);
VOP_UNLOCK(nd.ni_vp, 0, td);
- vn_close(nd.ni_vp, FREAD, p->p_ucred, td);
+ vn_close(nd.ni_vp, FREAD, td->td_ucred, td);
return error;
}
OpenPOWER on IntegriCloud