Commit Graph

73 Commits

Author SHA1 Message Date
mycroft 30d477000a The entry point address for the interpreter must be adjusted by the text
section VMA on all platforms.  It just happens to 0 normally on everything but
MIPS.
2002-09-12 16:57:44 +00:00
christos fea7af3bbe - Implement passing AT_{R,E}{U,G}ID in the elf aux vector.
- Pass struct proc to copyargs
- fix svr4_copyargs functions
2002-08-26 21:07:38 +00:00
simonb 4c67158999 Use "#ifdef __mips__" instead of "#ifdef mips"; shared libraries work
for kernels compiled with gcc 3.x.
2002-06-03 13:07:00 +00:00
thorpej 07d023a3aa Define ELF32_EHDR_FLAGS_OK()/ELF64_EHDR_FLAGS_OK() and use it
as an added measure to make sure that we can execute a binary.
These default to (1) if elf_machdep.h does not override them.

On Sun2, ELF32_EHDR_FLAGS_OK() checks for the presense of EF_M68000,
since the 68010 cannot run binaries for the 68020-and-up.
2002-01-28 22:15:54 +00:00
lukem adc783d537 add RCSIDs 2001-11-12 15:25:01 +00:00
thorpej e8ee04475d - Add a new vnode flag VEXECMAP, which indicates that a vnode has
executable mappings.  Stop overloading VTEXT for this purpose (VTEXT
  also has another meaning).
- Rename vn_marktext() to vn_markexec(), and use it when executable
  mappings of a vnode are established.
- In places where we want to set VTEXT, set it in v_flag directly, rather
  than making a function call to do this (it no longer makes sense to
  use a function call, since we no longer overload VTEXT with VEXECMAP's
  meaning).

VEXECMAP suggested by Chuq Silvers.
2001-10-30 15:32:01 +00:00
christos f2a8a907b4 simplify an expression. 2001-07-29 21:24:23 +00:00
christos 3e1e7a68e5 adjust to the new copyargs footprint 2001-07-29 21:22:58 +00:00
christos 2c913b0983 Fix problem reported by Greg Woods, with ld -n generated binaries.
Now if the requested alignment of the psection is less than PAGE_SIZE
we use readvn, not pagedvn and we don't adjust sizes.
2001-07-15 20:52:35 +00:00
christos 69f5770270 - add exec_read_from and make exec_elf32 use it.
- add a macho probe function
2001-07-14 02:08:29 +00:00
jdolecek 27a5a43c04 In the check_header() function, bump the number of allowed section headers
to 512. Apparently, there are ELF binaries with more than 128 section
headers - an example is one of Linux Word Perfect 8 utilities.

This fixes kern/12455 by Mark Davies.
2001-05-07 17:09:13 +00:00
eeh e938c4e842 *NEVER* cast a reference parameter (unless you're using C++). 2001-02-04 19:12:09 +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
mycroft f495cd9dc6 Introduce 2 new flags in types.h:
* __HAVE_SYSCALL_INTERN.  If this is defined, e_syscall is replaced by
  e_syscall_intern, which is called at key places in the kernel.  This can be
  used to set a MD syscall handler pointer.  This obsoletes and replaces the
  *_HAS_SEPARATED_SYSCALL flags.
* __HAVE_MINIMAL_EMUL.  If this is defined, certain (deprecated) elements in
  struct emul are omitted.
2000-12-11 05:28:59 +00:00
mrg 51858ad725 backout part of execsw/LKM changes: netbsd_elf32_signature() is used by
the compat/netbsd32 code so de-static it again.
2000-11-28 13:10:41 +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
thorpej 38ee35826a NBPG -> PAGE_SIZE. 2000-11-14 22:14:53 +00:00
jdolecek 78b866e95a change the type of *syscallnames[] array to 'const char * const foo[]' 2000-11-13 21:32:15 +00:00
chs a74393b970 remove unneeded includes. 2000-11-08 05:47:56 +00:00
thorpej cd32ace8bb ANSI'ify. 2000-08-01 04:57:28 +00:00
matt b4c1bfd1f3 modify load_file to load at relative vms'a as specified in the phdr's. 2000-07-13 02:35:25 +00:00
kleink a5eeea36d4 Add back a failure return statement in check_header() which I accidently
deleted in rev. 1.46; pointed out by Chris Demetriou.
2000-07-11 06:23:38 +00:00
mrg 32aa199ccf remove include of <vm/vm.h> 2000-06-27 17:41:07 +00:00
mrg 89d0a3e519 remove redundant vm includes. 2000-06-26 14:38:50 +00:00
soren 14573dc679 defopt SYSCALL_DEBUG. 2000-06-06 18:26:32 +00:00
chs a6d33cc1f2 add a new function vn_marktext() for exec code to let others know
that the vnode is now being used as process text.
2000-04-11 04:37:47 +00:00
eeh 8636e8eef7 Update for compat_netbsd32. 2000-02-06 16:49:51 +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
fvdl 811a6162c3 Allow execution of shared objects. This is silly, but is allowed in,
for example, Solaris and Linux, and at least one Linux ldd implementation
even depends on it.
1999-06-29 23:39:06 +00:00
cgd 1bce8c40fc ep_arglen is in units of 'sizeof (char *)', not in units of bytes. use
howmany(value, sizeof (char *)) to get the right value.
1999-04-30 23:02:06 +00:00
kleink f69591d12d Use of casts as lvalues is a GNU C extension; rearrange slightly. 1999-02-10 17:03:26 +00:00
christos fe1f028894 PR/6962: Paul Shupak: FreeBSD elf support. 1999-02-09 20:35:04 +00:00
christos 6434d50bd2 Fix 3 problems with the new signature code:
- don't set position to 0, set it to NO_ADDR (cgd)
- no need to malloc size + 1 bytes (cgd)
- fix calculation of minimum note size section.
1999-01-06 11:52:53 +00:00
christos 27e4ef39db Add support for parsing OS type note fields. 1998-12-23 15:08:37 +00:00
christos 10b5900f45 update for linux file move. 1998-10-03 20:39:32 +00:00
erh 8c963d5a04 Move elf function name macros to exec_elf.h. COMPAT_LINUX is no longer limited to ELFSIZE==32. 1998-10-01 16:06:24 +00:00
christos 34c5a58bb4 Make copyrights consistent; fix weird/trailing spaces add missing (c) etc. 1998-09-12 17:20:02 +00:00
christos 9b63f5f407 Assign copyright to TNF. 1998-09-05 14:30:31 +00:00
perry 275d1554aa Abolition of bcopy, ovbcopy, bcmp, and bzero, phase one.
bcopy(x, y, z) ->  memcpy(y, x, z)
ovbcopy(x, y, z) -> memmove(y, x, z)
   bcmp(x, y, z) ->  memcmp(x, y, z)
  bzero(x, y)    ->  memset(x, 0, y)
1998-08-04 04:03:10 +00:00
perry 730baa7431 fix sizeofs so they comply with the KNF style guide. yes, it is pedantic. 1998-07-31 22:50:48 +00:00
thorpej 6326c90134 Change the "aresid" argument of vn_rdwr() from an int * to a size_t *,
to match the new uio_resid type.
1998-07-28 18:37:47 +00:00
thorpej 816e12eac2 defopt COMPAT_SVR4 1998-06-26 00:07:06 +00:00
thorpej 311bac3348 defopt COMPAT_IBCS2 1998-06-25 23:22:37 +00:00
thorpej c466f11939 defopt COMPAT_LINUX 1998-06-25 23:18:23 +00:00
kleink fe2d01988e Fix some arithmetics lossage on typeless pointers. 1998-05-08 18:18:55 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
scottb 876dc027a1 added support for SCO UNIX (derived from iBCS2) 1998-02-09 01:29:10 +00:00
mycroft e3f99a9397 Pass the vnode type to vaccess(), and use it when checking VEXEC. Make sure
that the mode bits passed to vaccess() and returned by foo_getattr() contain
only permission bits.
1997-05-08 16:19:43 +00:00
mycroft 4d2eb6bb39 GC some code. 1997-05-08 12:17:47 +00:00
mycroft d7f33c5e60 va_mode contains stat bits. Use S_IS[UG]ID rather than VS[UG]ID. 1997-05-08 10:19:10 +00:00