add ep_entryoffset to exec_package so one can calculate the relocabase

of an ET_DYN image.
This commit is contained in:
matt 2014-03-06 09:30:37 +00:00
parent 342cd14faf
commit ab77483fb9
2 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec_elf.c,v 1.62 2014/02/27 09:58:05 maxv Exp $ */
/* $NetBSD: exec_elf.c,v 1.63 2014/03/06 09:30:37 matt Exp $ */
/*-
* Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc.
@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.62 2014/02/27 09:58:05 maxv Exp $");
__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.63 2014/03/06 09:30:37 matt Exp $");
#ifdef _KERNEL_OPT
#include "opt_pax.h"
@ -162,6 +162,7 @@ elf_placedynexec(struct lwp *l, struct exec_package *epp, Elf_Ehdr *eh,
for (i = 0; i < eh->e_phnum; i++)
ph[i].p_vaddr += offset;
epp->ep_entryoffset = offset;
eh->e_entry += offset;
}
@ -835,6 +836,7 @@ exec_elf_makecmds(struct lwp *l, struct exec_package *epp)
}
ap->arg_interp = epp->ep_vmcmds.evs_cmds[nused].ev_addr;
epp->ep_entryoffset = interp_offset;
epp->ep_entry = ap->arg_interp + interp_offset;
PNBUF_PUT(interp);
} else

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec.h,v 1.144 2014/01/03 20:52:47 dsl Exp $ */
/* $NetBSD: exec.h,v 1.145 2014/03/06 09:30:37 matt Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -200,6 +200,7 @@ struct exec_package {
vaddr_t ep_minsaddr; /* proc's min stack addr ("bottom") */
vsize_t ep_ssize; /* size of process's stack */
vaddr_t ep_entry; /* process's entry point */
vaddr_t ep_entryoffset; /* offset to entry point */
vaddr_t ep_vm_minaddr; /* bottom of process address space */
vaddr_t ep_vm_maxaddr; /* top of process address space */
u_int ep_flags; /* flags; see below. */