-/* $OpenBSD: exec_elf.c,v 1.161 2021/12/06 21:21:10 guenther Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.162 2021/12/07 04:19:24 guenther Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
*/
#define ELF_MAX_VALID_PHDR 32
-/*
- * How many entries are in the AuxInfo array we pass to the process?
- */
-#define ELF_AUX_ENTRIES 9
-
/*
* This is the OpenBSD ELF emul
*/
#else
NULL,
#endif
- (sizeof(AuxInfo) * ELF_AUX_ENTRIES / sizeof(char *)),
setregs,
exec_elf_fixup,
coredump_elf,
/* Second, write an NT_OPENBSD_AUXV note. */
notesize = sizeof(nhdr) + elfround(sizeof("OpenBSD")) +
- elfround(pr->ps_emul->e_arglen * sizeof(char *));
+ elfround(ELF_AUX_WORDS * sizeof(char *));
if (iocookie) {
iov.iov_base = &pss;
iov.iov_len = sizeof(pss);
return (EIO);
nhdr.namesz = sizeof("OpenBSD");
- nhdr.descsz = pr->ps_emul->e_arglen * sizeof(char *);
+ nhdr.descsz = ELF_AUX_WORDS * sizeof(char *);
nhdr.type = NT_OPENBSD_AUXV;
error = coredump_write(iocookie, UIO_SYSSPACE,
-/* $OpenBSD: init_main.c,v 1.309 2021/12/06 21:21:10 guenther Exp $ */
+/* $OpenBSD: init_main.c,v 1.310 2021/12/07 04:19:24 guenther Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
#else
NULL,
#endif
- 0,
setregs,
NULL, /* fixup */
NULL, /* coredump */
-/* $OpenBSD: kern_exec.c,v 1.224 2021/12/06 21:21:10 guenther Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.225 2021/12/07 04:19:24 guenther Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
}
/* Now check if args & environ fit into new stack */
- len = ((argc + envc + 2 + pack.ep_emul->e_arglen) * sizeof(char *) +
+ len = ((argc + envc + 2 + ELF_AUX_WORDS) * sizeof(char *) +
sizeof(long) + dp + sgap + sizeof(struct ps_strings)) - argp;
len = (len + _STACKALIGNBYTES) &~ _STACKALIGNBYTES;
if (copyout(&argc, cpp++, sizeof(argc)))
return (0);
- dp = (char *) (cpp + argc + envc + 2 + pack->ep_emul->e_arglen);
+ dp = (char *) (cpp + argc + envc + 2 + ELF_AUX_WORDS);
sp = argp;
/* XXX don't copy them out, remap them! */
-/* $OpenBSD: sys_process.c,v 1.88 2021/05/10 18:01:24 mpi Exp $ */
+/* $OpenBSD: sys_process.c,v 1.89 2021/12/07 04:19:24 guenther Exp $ */
/* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */
/*-
#include <sys/ptrace.h>
#include <sys/uio.h>
#include <sys/sched.h>
+#include <sys/exec_elf.h>
#include <sys/mount.h>
#include <sys/syscallargs.h>
case PIOD_READ_AUXV:
req = PT_READ_D;
uio.uio_rw = UIO_READ;
- temp = tr->ps_emul->e_arglen * sizeof(char *);
+ temp = ELF_AUX_WORDS * sizeof(char *);
if (uio.uio_offset > temp)
return EIO;
if (uio.uio_resid > temp - uio.uio_offset)
-/* $OpenBSD: exec_elf.h,v 1.91 2021/11/12 22:20:57 guenther Exp $ */
+/* $OpenBSD: exec_elf.h,v 1.92 2021/12/07 04:19:24 guenther Exp $ */
/*
* Copyright (c) 1995, 1996 Erik Theisen. All rights reserved.
*
#endif
#ifdef _KERNEL
+/*
+ * How many entries are in the AuxInfo array we pass to the process?
+ */
+#define ELF_AUX_ENTRIES 9
+#define ELF_AUX_WORDS (sizeof(AuxInfo) * ELF_AUX_ENTRIES / sizeof(char *))
+
struct exec_package;
int exec_elf_makecmds(struct proc *, struct exec_package *);
-/* $OpenBSD: proc.h,v 1.318 2021/12/06 21:21:10 guenther Exp $ */
+/* $OpenBSD: proc.h,v 1.319 2021/12/07 04:19:24 guenther Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
int e_nsysent; /* Number of system call entries */
struct sysent *e_sysent; /* System call array */
char **e_syscallnames; /* System call name array */
- int e_arglen; /* Extra argument size in words */
- /* Copy arguments on the stack */
void (*e_setregs)(struct proc *, struct exec_package *,
u_long, register_t *);
int (*e_fixup)(struct proc *, struct exec_package *);