From ce337d2759598509d65c163dfad9e363268bf1f8 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 18 Oct 1995 07:04:58 +0000 Subject: Added some #includes. (struct execdata): Moved here from exec.c. (std_*): Declare these. (finish, check_hashbang): Declare them. --- exec/priv.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) (limited to 'exec') diff --git a/exec/priv.h b/exec/priv.h index becb95aa..7b00d9a8 100644 --- a/exec/priv.h +++ b/exec/priv.h @@ -19,8 +19,13 @@ along with the GNU Hurd; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include +#include +#include +#include #include #include +#include +#include #include #include #include @@ -61,4 +66,77 @@ typedef struct trivfs_protid *trivfs_protid_t; /* For MiG. */ extern mach_port_t procserver; /* Our proc port. */ + +/* Data shared between check, check_section, + load, load_section, and finish. */ +struct execdata + { + /* Passed out to caller. */ + error_t error; + + /* Set by check. */ + vm_address_t entry; + FILE stream; + file_t file; + +#ifdef BFD + bfd *bfd; +#endif + union /* Interpreter section giving name of file. */ + { + asection *section; + const Elf32_Phdr *phdr; + } interp; + memory_object_t filemap, cntlmap; + struct shared_io *cntl; + char *file_data; /* File data if already copied in core. */ + off_t file_size; + size_t optimal_block; /* Optimal size for io_read from file. */ + + /* Set by caller of load. */ + task_t task; + + union + { + /* Vector indexed by section index, + information passed from check_section to load_section. + Set by caller of check_section and load. */ + vm_offset_t *bfd_locations; + struct + { + /* Program header table read from the executable. + After `check' this is a pointer into the mapping window. + By `load' it is local alloca'd storage. */ + Elf32_Phdr *phdr; + Elf32_Word phnum; /* Number of program header table elements. */ + int anywhere; /* Nonzero if image can go anywhere. */ + vm_address_t loadbase; /* Actual mapping location. */ + } elf; + } info; + }; + +void finish (struct execdata *, int dealloc_file_port); + +void check_hashbang (struct execdata *e, + file_t file, + task_t oldtask, + int flags, + char *argv, u_int argvlen, boolean_t argv_copy, + char *envp, u_int envplen, boolean_t envp_copy, + mach_port_t *dtable, u_int dtablesize, + boolean_t dtable_copy, + mach_port_t *portarray, u_int nports, + boolean_t portarray_copy, + int *intarray, u_int nints, boolean_t intarray_copy, + mach_port_t *deallocnames, u_int ndeallocnames, + mach_port_t *destroynames, u_int ndestroynames); + + +/* Standard exec data for secure execs. */ +extern mach_port_t *std_ports; +extern int *std_ints; +extern size_t std_nports, std_nints; +extern struct rwlock std_lock; + + #endif /* exec_priv_h */ -- cgit v1.2.3