diff options
author | sos <sos@FreeBSD.org> | 1996-03-10 08:42:54 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 1996-03-10 08:42:54 +0000 |
commit | 7d151a09c3f9613590f35dad81c77959e4f34381 (patch) | |
tree | ab85b2b967b056b586d4e20e909a63357cd88185 /sys/kern/kern_exec.c | |
parent | bfb211a9a540fa804c574162f720bebded3fcddf (diff) | |
download | FreeBSD-src-7d151a09c3f9613590f35dad81c77959e4f34381.zip FreeBSD-src-7d151a09c3f9613590f35dad81c77959e4f34381.tar.gz |
First attempt at FreeBSD & Linux ELF support.
Compile and link a new kernel, that will give native ELF support, and
provide the hooks for other ELF interpreters as well.
To make native ELF binaries use John Polstras elf-kit-1.0.1..
For the time being also use his ld-elf.so.1 and put it in
/usr/libexec.
The Linux emulator has been enhanced to also run ELF binaries, it
is however in its very first incarnation.
Just get some Linux ELF libs (Slackware-3.0) and put them in the
prober place (/compat/linux/...).
I've ben able to run all the Slackware-3.0 binaries I've tried
so far.
(No it won't run quake yet :)
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r-- | sys/kern/kern_exec.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 65fdaff..954cce1 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_exec.c,v 1.35 1996/02/24 14:32:52 peter Exp $ + * $Id: kern_exec.c,v 1.36 1996/03/02 19:38:08 peter Exp $ */ #include <sys/param.h> @@ -42,6 +42,7 @@ #include <sys/acct.h> #include <sys/exec.h> #include <sys/imgact.h> +#include <sys/imgact_elf.h> #include <sys/wait.h> #include <sys/malloc.h> #include <sys/sysent.h> @@ -118,6 +119,7 @@ execve(p, uap, retval) imgp->vmspace_destroyed = 0; imgp->interpreted = 0; imgp->interpreter_name[0] = '\0'; + imgp->auxargs = NULL; /* * Allocate temporary demand zeroed space for argument and @@ -475,11 +477,24 @@ exec_copyout_strings(imgp) ((caddr_t)arginfo - szsigcode), szsigcode); /* + * If we have a valid auxargs ptr, prepare some room + * on the stack. + */ + if (imgp->auxargs) + /* + * The '+ 2' is for the null pointers at the end of each of the + * arg and env vector sets, and 'AT_COUNT*2' is room for the + * ELF Auxargs data. + */ + vectp = (char **)(destp - (imgp->argc + imgp->envc + 2 + + AT_COUNT*2) * sizeof(char*)); + else + /* * The '+ 2' is for the null pointers at the end of each of the - * arg and env vector sets + * arg and env vector sets */ - vectp = (char **) (destp - - (imgp->argc + imgp->envc + 2) * sizeof(char *)); + vectp = (char **) + (destp - (imgp->argc + imgp->envc + 2) * sizeof(char*)); /* * vectp also becomes our initial stack base |