Commit Graph

51 Commits

Author SHA1 Message Date
manu ac10cf6946 Added a linux_atexit_signature to match Linux statically linked ELF binaries. It
searches for a __libc_atexit ELF section, which is specific to Linux
2001-01-19 01:43:31 +00:00
mycroft b29180b2ff Tighten up the ELF signature checks, and actually look for the ABI tag added
in newer glibc versions.
2000-12-15 06:14:21 +00:00
jdolecek 01040d97a2 add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
2000-12-01 12:28:30 +00:00
jdolecek baae0324b9 restructure struct emul and execsw, in preparation to make emulations LKMable:
* move all exec-type specific information from struct emul to execsw[] and
  provide single struct emul per emulation
* elf:
  - kern/exec_elf32.c:probe_funcs[] is gone, execsw[] how has one entry
    per emulation and contains pointer to respective probe function
  - interp is allocated via MALLOC() rather than on stack
  - elf_args structure is allocated via MALLOC() rather than malloc()
* ecoff: the per-emulation hooks moved from alpha and mips specific code
  to OSF1 and Ultrix compat code as appropriate, execsw[] has one entry per
  emulation supporting ecoff with appropriate probe function
* the makecmds/probe functions don't set emulation, pointer to emulation is
  part of appropriate execsw[] entry
* constify couple of structures
2000-11-21 00:37:49 +00:00
erh f96aee80d6 Make the linux compatibilty code work on the alpha. (horay!) (at last!)
Two main changes:
	Create a linux_elf64_copyargs that uses the linux specific LinuxAuxInfo
	structure.  This is only used on the alpha.  i386 and m68k use the
	standard elf copyargs function.

	Since linux's approach to binary compatibilty is to look as much
	like osf1 as possible, add all the osf1 syscalls that we have
	implemented to the linux syscall table.  This includes get/setsysinfo,
	ported from FreeBSD.

In order for linux compat to work you must have COMPAT_OSF1, COMPAT_43,
COMPAT_09, COMPAT_12 and COMPAT_13 on also.
2000-11-17 03:55:17 +00:00
jdolecek 78b866e95a change the type of *syscallnames[] array to 'const char * const foo[]' 2000-11-13 21:32:15 +00:00
mrg c48063facd remove include of <vm/vm.h> 2000-06-29 02:40:37 +00:00
mrg 89d0a3e519 remove redundant vm includes. 2000-06-26 14:38:50 +00:00
kleink 522cbf0248 Update to match new SVR4-style definition names in <sys/exec_elf.h>. 1999-10-25 13:55:06 +00:00
cgd af8a9059d3 compute the value to be used for e_arglen via howmany(value, sizeof (char *)),
rather than just "value / sizeof (char *)".  While in these cases the latter
works as well, the former's a better example for other uses to copy (since
it handles the non-integral multiple case correctly).
1999-04-30 23:07:01 +00:00
christos c8216580df const poisoning. 1999-02-09 20:37:19 +00:00
erh bda913305b Make sure the interpreter string is long enough to check against. 1998-11-05 22:19:25 +00:00
veego 4c127bdcd4 Include linux_errno.h to fix the recent error->errno losage. 1998-10-23 10:54:58 +00:00
erh 8b351f0104 Change linux_error to native_to_linux_errno. Add some (unrelated) debugging printfs. 1998-10-23 03:53:18 +00:00
erh c7176f00e4 The siginfo include line is not needed here anymore. 1998-10-07 22:17:57 +00:00
christos 9ec65653f5 unobfuscate: !strncmp() != 0 -> strncmp() == 0 1998-10-04 16:51:18 +00:00
fvdl 19f71dc8ff Fix wrong strncmp test. 1998-10-04 09:40:09 +00:00
fvdl 8096c25afc Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
1998-10-04 00:02:23 +00:00
christos 96dc2f3c56 Remove stray debugging printfs 1998-10-03 20:28:03 +00:00
christos 908291d2fe Attempt to fix the mess. 1998-10-03 20:17:36 +00:00
erh f7ac1bd375 Split compat/linux/linux_exec.c into common, elf and a.out parts. 1998-10-01 03:11:33 +00:00
mycroft fb526e055c Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
  versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
  sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
  sys_sigpending() and sys_sigsuspend() into separate functions, and call them
  from all the emulations rather than hard-coding everything.  (Avoids uses
  the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
  pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
  bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
  in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified.  Other ports and
emulations need to be updated.
1998-09-11 12:50:05 +00:00
christos 8fb507a3b7 Assign copyright to TNF. 1998-09-05 14:50:25 +00:00
perry e1601dc2ca bzero->memset, bcopy->memcpy, bcmp->memcmp 1998-08-09 20:36:58 +00:00
thorpej 37b70b3064 Change the "aresid" argument of vn_rdwr() from an int * to a size_t *,
to match the new uio_resid type.
1998-07-28 21:39:54 +00:00
mycroft 72623d8443 Use linux_setregs(). 1998-01-24 12:32:15 +00:00
christos d551a4edf9 catch up with Jason's exec.h inclusion. 1996-10-13 18:30:05 +00:00
christos 5476886e52 printf -> kprintf, sprintf -> ksprintf 1996-10-10 17:47:29 +00:00
cgd 912e6fef44 include <sys/exec.h> rather than <machine/exec.h> 1996-10-07 21:47:33 +00:00
jtk fb2727b7e6 update to compile; needs new enum name 'Elf_sht_progbits' 1996-10-05 00:12:49 +00:00
cgd 65148dea43 kill (re)definitions of EXEC_ELF32. They're no longer necessary
(because of the EXEC_* option changes), and now cause warnings.
1996-10-03 05:02:05 +00:00
thorpej 8dd444adbd Fix a section header check that didn't get updated with the elf32/elf64
changes.  Make this compile again with the new EXEC_* options.
1996-10-03 02:16:18 +00:00
christos 76f9ea8676 Elf32_sht_progbits -> Elf_sht_progbits 1996-09-30 23:56:01 +00:00
cgd 7c3255776d slightly clean up some of the changes made when ELF64 support went in 1996-09-27 18:14:23 +00:00
cgd 9c3e274c7b adapt ELF-using compat code to use new ELF definitions/code. At this point,
these are restricted to 32-bit ELF, and should be severely cleaned.
1996-09-26 20:52:42 +00:00
mycroft a8fd25767d Define execv() and execve() consistently across emulations.
Do path name translation.
1996-09-03 03:12:17 +00:00
christos d83602c110 Simplify and add comments. 1996-06-13 19:27:01 +00:00
christos 4d9a6e0930 - Pass the Elf32_Ehdr in the linux probe function, and use it!
Since linux binaries are (mostly) always compiled with gcc, look for
the gcc signature in the .comment section header: "\0 GCC: (GNU) ".
I've changed the probe order in kern/exec_elf.c to probe for linux ELF
binaries first and fall back to SVR4 binaries. This makes statically
linked binaries work for both linux and svr4. Note that gcc-compiled
svr4 binaries, still contain the operating system signature first and
then the GCC signature, so there is no conflict. Yes this is a hack.
1996-06-13 18:42:01 +00:00
christos 151fa70f78 Prototyping changes. 1996-04-05 00:01:10 +00:00
mycroft 245f292fed Prefix names of system call implementation functions with `sys_'. 1995-10-07 06:25:19 +00:00
thorpej e1da0d5390 Make system calls conform to a standard prototype and bring those
prototypes into scope.
1995-09-19 22:37:27 +00:00
mycroft 88b8e43a80 Rearrange #includes. 1995-08-14 01:27:43 +00:00
christos 6b95b513b0 Use compat_util.[ch]. 1995-06-24 20:20:04 +00:00
fvdl c4aaa6000c * Changed to use generic ELF code from kern/exec_elf.c (which was taken
from the svr4 exec code plus the linux compat mods)
* Include file change
* Add multicast sockopts (from John Brezak)
1995-06-22 21:34:27 +00:00
fvdl fb777788b1 Don't forget to acknowledge that all the ELF stuff was taken from
Christos' svr4 code.
1995-06-11 15:15:09 +00:00
fvdl fc7cfb5f0b * Make Linux ELF binaries work. Lots of code duplication, but it will have to do
for now.
* Add a sanity check in linux_uselib
1995-06-11 14:56:47 +00:00
mycroft bfd22ffde8 Generate the new ps_strings format. 1995-05-16 14:19:03 +00:00
christos 44eef7c28b - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
1995-04-22 19:48:19 +00:00
fvdl 623f1e3986 Handle Linux signal tramp code differently. Some changes because of the
now seperate Linux signal trampoline code. Add linux_sigreturn to
syscalls.master.
1995-04-07 22:23:22 +00:00
fvdl 182c23c8bc Added a few more system calls.
More consistent alternate root file semantics throughout.
1995-03-05 23:23:37 +00:00