2009-04-03 Samuel Thibault * exec.c (prepare): Call PREPARE_STREAM earlier to permit calling finish_mapping on E even after errors, as is already done in do_exec. 2008-06-10 Samuel Thibault * elfcore.c (TIME_VALUE_TO_TIMESPEC): Completely implement instead of casting `time_value *' into `struct timeval *'. (dump_core): Reimplement timeradd instead of casting `time_value *' into `struct timeval *'. 2004-10-22 Roland McGrath * exec.c (check_elf_phdr): Return early on setting ENOEXEC. Only touch E->info.elf.phdr_addr once, on the PT_LOAD segment that actually contains the e_phoff location in the file. (do_exec): If E.info.elf.phdr_addr is zero, don't set BOOT->phdr_size. 2004-09-26 Roland McGrath * priv.h (struct execdata.info.elf): New field `phdr_addr'. * exec.c (check_elf): Set E->info.elf.phdr_addr here from e_phoff. (check_elf_phdr): Don't check for PT_PHDR, remove last two args. (do_exec): Update callers. Set BOOT->phdr_addr and BOOT->phdr_size using info saved by check_elf. 2004-02-11 Roland McGrath * exec.c (servercopy): Change signature to avoid casted arguments. Update callers. (do_exec, S_exec_setexecdata): Update callers. 2004-02-10 Roland McGrath * elfcore.c (dump_core): Include null terminator in note name size, and round up to four byte alignment. (dump_core: write_note): Don't round OFFSET after each partial write. (dump_core): Don't round up to page size before writing notes. Do round up to page size for offset of each PT_LOAD region. 2004-01-15 Roland McGrath * priv.h (struct execdata.info.elf): Add `execstack' flag. * exec.c (check_elf_phdr): Set it according to PT_GNU_STACK's PF_X flag bit. If no PT_GNU_STACK, default to set. (do_exec): If flag is clear, remove execute permission from stack. 2002-09-17 Roland McGrath * elfcore.c [i386_THREAD_STATE] (fetch_thread_regset): The two types are not actually identical, must rearrange some members a little. 2002-06-13 Roland McGrath * priv.h (trivfs_protid_t): Type removed (now in trivfs.h). 2002-05-29 Roland McGrath * hashexec.c (check_hashbang): Fix fs id port arg in io_identity call. * elfcore.c (dump_core): int -> size_t 2002-05-10 Roland McGrath * exec.c (prepare): Do io_stat when io_map fails as for when io_map_cntl fails. 2002-05-01 Roland McGrath * elfcore.c [ALPHA_THREAD_STATE] (ELF_MACHINE, fetch_thread_regset, fetch_thread_fpregset): New definitions for Alpha CPU. 2002-04-27 Roland McGrath * priv.h: Include to get ElfW macro. * priv.h, exec.c, main.c, hostarch.c: Use `ElfW(TYPE)' in place of `Elf32_TYPE' throughout. 2002-03-11 Roland McGrath * core.c: File removed. * Makefile (DIST_FILES): Remove core.c from the list. * elfcore.c: New file, used by crash server (../trans) to write ELF core dump files. Thanks to Jon Arney for spurring me to write this, and for helping to test and debug it. 2002-01-02 Roland McGrath * exec.c (do_exec) [KERN_INVALID_LEDGER]: Pass extra arguments to task_create for OSF variant. 2002-01-01 Roland McGrath * execmutations.h (SERVERCOPY): New macro. 2001-12-31 Roland McGrath * exec.c (do_exec): thread_array_t -> thread_t * 2001-11-23 Roland McGrath * gcore.c: File moved to ../utils. * Makefile (DIST_FILES): Remove it. 2001-04-01 Neal H Walfield * main.c (S_exec_init): Use iohelp_create_empty_iouser. 2001-06-15 Roland McGrath * exec.c (do_exec: user_fd): Add a user ref to returned port. 2001-02-12 Marcus Brinkmann * main.c: Change hurd version name from proc to exec. (main): Add period to doc string. 2000-10-01 Roland McGrath * exec.c: Comments. 2000-09-24 Roland McGrath * exec.c (map): Bail if the requested position + data size does not fit in the file size. 2000-07-26 Mark Kettenis * Makefile (HURDLIBS): Reorder libs such that the threads lib comes before the ports lib. This makes sure the functions in libthreads properly override the stubs in libports with the new dynamic linker semantics in glibc 2.2. 2000-07-20 Thomas Bushnell, BSG * hashexec.c (check_hashbang): Count characters in interp correctly. Fix from Kalle Olavi Niemitalo . 2000-03-23 Mark Kettenis * exec.c (do_exec): Set interp.file to MACH_PORT_NULL before the first `goto out'. 2000-03-20 Roland McGrath * main.c (trivfs_allow_open): Initialize to zero. (trivfs_support_read, trivfs_support_write): Likewise. (trivfs_support_exec): Variable removed. * exectrans.c: Obsolete file removed. * Makefile (DIST_FILES): Remove it. 2000-03-17 Roland McGrath * hashexec.c (check_hashbang): Use strpbrk directly instead of strsep. Fix up INTERP_LEN properly in the no-argument case. 2000-03-17 Thomas Bushnell, BSG * main.c (S_exec_init): Don't use MOVE_SEND in Hurd RPC. 2000-03-17 Roland McGrath * exec.c (do_exec): Use ports_get_send_right. 2000-03-13 Roland McGrath * priv.h (EXECDATA_STREAM): Define this only #ifdef BFD. The non-BFD exec server is now completely independent of stdio magic; it uses only those interfaces documented in the C library manual, which are provided both by old GNU stdio and by GNU libio. Resurrecting the BFD exec server will require using magic again, for which libio-specific magic needs to be written. * exec.c [! EXECDATA_STREAM] (prepare_stream): Replace no-op with real function to initialize map_* members to zero. * priv.h (EXECDATA_STREAM): New macro, always defined for now. (struct execdata) [! EXECDATA_STREAM]: Add members map_buffer, map_bsize, map_fsize, map_filepos in place of stream. (map_buffer, map_filepos, map_set_fsize): New macros for accessing those or stream. [! EXECDATA_STREAM] (map_fsize, map_vsize): Define using new members. * exec.c (map): Rewritten purely using those accessor macros. (input_room): Set the __target, __bufp, __error, and __eof members, which are no longer set by map. [! EXECDATA_STREAM] (prepare_stream, prepare_in_memory): Make no-ops. (input_room, close_exec_stream, fake_seek, prepare_stream, prepare_in_memory): Conditionalize these defns on [EXECDATA_STREAM]. (load_section): Always use map instead of stdio. Replace bcopy with memcpy. (check_gzip: zipread): Rewrite using map instead of stdio. (check_bzip2: zipread): Likewise. * hashexec.c (check_hashbang): Fix up multiple fencepost brainos. * hashexec.c (check_hashbang): Fix fencepost error in last change. * exec.c (map): Made global. * priv.h: Declare it. (map_fsize, map_vsize): New macros for accessing state set up by map. * hashexec.c (check_hashbang): Use map and copying operations rather than stdio to extract the first line from the file. Move finish call to immediately after reading the line. * exec.c (map): If E->file_data is set, diagnose EOF before going to direct io_read. (prepare_in_memory): New function, broken out of check_gzip before last change. (check_gzip, check_bzip2): Use it. * exec.c (prepare_stream): New function, broken out of prepare. (prepare): Call it. [_STDIO_USES_IOSTREAM]: Do #error if this is defined. (map, input_room, close_exec_stream, fake_seek, prepare_stream): Conditionalize all these definitions on [! _STDIO_USES_IOSTREAM]. Only map and prepare_stream are called from elsewhere in the code. (check_gzip): Don't reinitialize E->stream, since it will in fact not be used again. (check_bzip2): Likewise. 2000-03-09 Roland McGrath * hostarch.c (elf_machine_matches_host): Don't recognize EM_486, since newer 's don't define it any more. 2000-02-27 Roland McGrath * hashexec.c (check_hashbang: user_fd): Add a user ref to DTABLE[FD] send right, because caller (hurd_file_name_lookup internals) will consume one. * hashexec.c (check_hashbang): When dealloc'ing DTABLE ports, optimize out syscall for null ports. 1999-11-08 Roland McGrath * exectrans.c (trivfs_support_write, trivfs_support_exec): Variables removed. (trivfs_allow_open): Set to just O_READ. 1999-09-09 Roland McGrath * Makefile (exec.static-LDFLAGS): Variable removed. 1999-07-17 Roland McGrath * exec.c (servercopy): Removed unused variable. 1999-07-11 Roland McGrath * exec.c (load_section): Fix typos in last change. 1999-07-11 Thomas Bushnell, BSG * exec.c (load_section): Use mmap instead of vm_allocate when allocating in mach_task_self (). (servercopy): Likewise. (do_exec): Likewise. * hashexec.c (check_hashbang): Likewise. 1999-07-10 Roland McGrath * hostarch.c (mach_host_elf_machine): Replaced with ... (elf_machine_matches_host): New function. Instead of returning an ELF EM_* code, take one and check if it matches the host; operate only on mach_host_self(), cache results, Grok CPU_TYPE_{I486,PENTIUM,PENTIUMPRO} to accept EM_386 or EM_486. Grok POWERPC, ALPHA, HPPA types. * exec.c (check_elf): Call elf_machine_matches_host instead of comparing against elf_machine. (load_section): #if 0 out no-op code that uses elf_machine. * priv.h (elf_machine_matches_host): Declare it. (elf_machine, mach_host_elf_machine): Remove decls. * main.c (main) [!BFD]: Don't call mach_host_elf_machine. (elf_machine): Variable removed. * exec.c (map): Don't cast arg to munmap to vm_address_t. * priv.h: Add #include for munmap decl. 1999-07-03 Thomas Bushnell, BSG * core.c (core_dump_task): Use munmap instead of vm_deallocate, when it's from our own task. * elfcore.c: Likewise. * exec.c (load_section): Likewise. (map): Likewise. (close_exec_stream): Likewise. (finish_mapping): Likewise. (load): Likewise. (do_exec): Likewise. (S_exec_setexecdata): Likewise. * hashexec.c (check_hashbang): Likewise. * main.c (deadboot): Likewise. 1999-06-04 Roland McGrath * exec.c (map): Fix mapping calls to use F->__offset consistently instead of F->__target. 1999-05-16 Roland McGrath * hashexec.c (check_hashbang): Fix bug in last change. 1999-05-15 Roland McGrath * hashexec.c (check_hashbang): Trim trailing blanks after interpreter argument. 1998-09-05 OKUJI Yoshinori * do-bunzip2.c: New file. * exec.c (check_bzip2): New function. (BZIP2): New cpp symbol. If defined, bunzip2 engine is enabled. * Makefile (bzip2-objects): New variable. (OBJS): Add bzip2-objects. (CPPFLAGS): Add -DBZIP2. 1999-04-27 Roland McGrath * exec.c (do_exec): Implement EXEC_SIGTRAP flag. 1998-12-27 Roland McGrath * main.c (S_exec_init): Deallocate PROCSERVER port when finished. 1998-12-27 Roland McGrath * main.c (S_exec_init): Remove variable DEV_MASTER; pass null instead since we don't need it. Use assert_perror on getting the host-priv port and on startup_essential_task, since init will hang until we've done made that RPC. 1998-12-26 Roland McGrath * exec.c (do_exec): Fix conditional for cleaning up INTERP, from nonnull E.interp.section to nonnull INTERP.file. If we failed to open the interpreter file, INTERP.file will be null and the rest of INTERP will be uninitialized. 1998-12-21 Roland McGrath * main.c (S_exec_init): Don't call set_active_trans. (set_active_trans): Function removed. * Makefile (HURDLIBS): Add missing implied library deps. 1998-11-25 Mark Kettenis * main.c (S_exec_init): Call _hurd_proc_init with new args set to zero. * hashexec.c (check_hashbang): Fix typo: interplen -> interp_len. Thu Nov 5 15:26:50 1998 Thomas Bushnell, BSG * hashexec.c (check_hashbang): Keep INTERP_LEN with the correct value (bytes of memory holding INTERP) for later use. (check_hashbang: setup_args): Set argv[0] from the interpreter name, not copied from the existing command line. 1998-10-26 Roland McGrath * hashexec.c: Use mach_* instead of __mach_*. 1998-07-15 Roland McGrath * exec.c (do_exec): Set boot->phdr_addr and boot->user_entry after loading, to addresses adjusted for actual run-time load address. Wed Aug 20 14:02:11 1997 Thomas Bushnell, n/BSG * main.c (main): New args for ports_manage_port_operations_multithread. 1997-06-30 Miles Bader * main.c (main): Arg parsing added. (argp_program_version): New variable. Include . Mon Jan 20 16:16:33 1997 Miles Bader * hashexec.c (check_hashbang): `preempter' -> `preemptor'. Sat Nov 23 16:26:55 1996 Thomas Bushnell, n/BSG * priv.h (mach_host_elf_machine): New prototype. * hostarch.c: Include "priv.h". Mon Nov 18 17:45:48 1996 Thomas Bushnell, n/BSG * exec.c (load_section): If ANYWHERE, then make sure ADDR starts out at least past the first page, so that we don't take it. Then the library can (if desired) make the page no-access. Fri Nov 15 17:34:23 1996 Thomas Bushnell, n/BSG * exec.c: Don't include any more. * main.c (S_exec_init): New arg syntax of trivfs_open. Mon Oct 7 21:31:25 1996 Thomas Bushnell, n/BSG * exec.c (fake_seek): New function. (prepare): Initialize E->stream.__io_funcs.seek to fake_seek; this is called now that stdio doesn't assume it always knows the file position. Thu Sep 12 16:30:12 1996 Thomas Bushnell, n/BSG * Makefile (HURDLIBS): New variable. (exec): Delete special dependencies. Thu Sep 5 11:11:19 1996 Thomas Bushnell, n/BSG * main.c: Include . (exec_version): Delete variable. (S_exec_init): Pass empty string as release; HURD_VERSION as version. Thu Aug 29 13:00:38 1996 Thomas Bushnell, n/BSG * priv.h: Only include if BFD. Only declare host_bfd_arc_info, and bfd_host_bfd if BFD. If not BFD, give typedef for asection. * main.c: Only define host_bfd_arch_info, host_bfd, and bfd_mach_host_arch_mach if BFD. (main): Only call bfd_mach_most_arch_mach if BFD. Call mach_host_elf_machine. * hostarch.c (bfd_mach_host_arch_mach): Only define if BFD. Delete arg E_MACHINE. All callers changed. (mach_host_elf_machine): New function. Sun Jul 7 21:13:22 1996 Michael I. Bushnell, p/BSG * exec.c (S_exec_exec): Don't use unsafe MOVE_SEND in call to interruptible exec_exec stub. Mon Jul 1 16:08:03 1996 Michael I. Bushnell, p/BSG * Makefile (DIST_FILES): Removed crash.c. * crash.c: Moved to ../trans. Thu Jun 20 15:43:51 1996 Michael I. Bushnell, p/BSG * Makefile (exec): Link against fshelp too now. * exec.c (do_exec): Call proc_setowner *after* possible proc_reassign; otherwise it modifies the stub process's state and not the real process's. Wed Jun 19 14:08:15 1996 Miles Bader * exec.c (do_exec, S_exec_exec): Pass 0 for new LOOKUP arg to hurd_file_name_lookup. * hashexec.c (hurd_file_name_path_lookup): Declaration removed. (check_hashbang): Pass 0 for new LOOKUP arg to hurd_file_name_lookup. Wed Jun 12 21:17:33 1996 Michael I. Bushnell, p/BSG * gzip.h (basename): Comment out declaration; it conflicts with libc's. * exec.c (do_exec): If secure, set the owner with proc_setowner. Fri May 10 16:47:11 1996 Miles Bader * hashexec.c (search_path): Don't make PATH or PFXED_NAME const. Fri May 10 09:20:26 1996 Michael I. Bushnell, p/BSG * exec.c (do_exec) [use1]: Use new auth_user_authenticate interface. * hashexec.c (check_hashbang) [userport/reauthenticate]: Likewise. * hashexec.c (check_hashbang) [setup_args/search_path]: Declare PATH to be `char const *'. Tue May 7 16:24:52 1996 Roland McGrath * hashexec.c (check_hashbang): Use io_identity instead of io_stat to compare files. Mon May 6 14:26:41 1996 Michael I. Bushnell, p/BSG * main.c (exec_version): Upgrade to 0.0. Fri May 3 14:16:17 1996 Roland McGrath * exec.c (map): Use F->__offset and F->__target properly. Thu May 2 10:21:37 1996 Roland McGrath * exec.c (map): Fix fencepost error in check of current mapping window. Request round_page (LEN) bytes in io_read to avoid many small reads. * exec.c (do_exec): Terminate OLDTASK if we get an error after killing its threads and deallocating its address space. Tue Apr 30 11:36:25 1996 Michael I. Bushnell, p/BSG * exec.c (check_gzip) [ziprderr]: Treat all read errors as ENOEXEC. First off, because that's what they are; also because some callers of read_error don't set errno at all. Mon Apr 29 15:11:55 1996 Michael I. Bushnell, p/BSG * exec.c (check_section): If the format makes no sense, return ENOEXEC, not EINVAL. (check_bfd): Likewise. (check_elf): Likewise. (check_elf_phdr): Likewise. (do_exec): Likewise. * exec.c (do_exec): Use correct args to ports_create_port. Sat Apr 27 06:02:42 1996 Roland McGrath * crash.c: Use ports_create_port instead of ports_allocate_port, and notice the error. * exec.c: Likewise. Tue Apr 23 18:53:54 1996 Roland McGrath * hashexec.c (check_hashbang: user_port): Use default root port when secure. Mon Apr 15 12:48:35 1996 Michael I. Bushnell, p/BSG * Makefile (DIST_FILES): Add elfcore.c, crash.c, and exectrans.c. (SRCS): That's hashexec.c, not .o. * Makefile (exec-MIGSFLAGS): Look for execmutations.h in $(srcdir). Mon Apr 8 15:49:39 1996 Miles Bader * exec.c (prepare): If io_map returns EOPNOTSUPP, suppress the error, and still setup E's stream. (prepare_and_check): If prepare returns an error, do no more. Thu Mar 28 14:06:07 1996 Miles Bader * hashexec.c (check_hashbang): Pass open flags & mode args to hurd_file_name_path_lookup. Mon Feb 26 16:33:22 1996 Miles Bader * hashexec.c (check_hashbang): Correctly deal with interpreter lines having no argument. Sat Jan 13 12:28:03 1996 Miles Bader * hashexec.c (check_hashbang): Use hash_file_name_path_lookup() instead of doing the path search ourselves, and get rid of LOOKUP_CWDIR & associated logic. * exec.c (S_exec_exec): Use strdupa(). Also update use of hurd_file_name_lookup() [still probably not right though]. Thu Jan 11 15:36:18 1996 Miles Bader * hashexec.c (check_hashbang): When using executable name found on the path, don't return alloca()ed memory from search_path(); use malloc() instead. Use envz_get() to search the environment. * exec.c (S_exec_exec): Use envz_get() to search the environment. Thu Jan 4 11:30:15 1996 Roland McGrath * exec.c (safe_bzero): Rewritten using hurd_catch_signal. * hashexec.c (check_hashbang): Rearrange arg frobbing code somewhat to use hurd_catch_signal instead of old preemption interface. Fri Dec 29 15:54:06 1995 Miles Bader * exec.c (do_exec): Be careful not to look at BOOT after we release our reference on it. Correctly initialize BOOT->intarray in the case where NINTS < INIT_INT_MAX but we don't alloc a new array. Fri Dec 15 01:53:07 1995 Roland McGrath * exec.c (map): Rearrange code to fix some bugs and not remap unless necessary. (input_room): Simplify. (check_elf): Extract all information from file header before calling `map' for program headers. Sat Nov 25 22:10:41 1995 Miles Bader * crash.c (S_msg_sig_post_untraced): Also let the debugger have the process back if it's posting the crashing signal. Tue Nov 21 15:01:56 1995 Roland McGrath * exec.c (safe_bzero): New function, broken out of load_section. (load_section): Call it. * main.c (going_down): Variable removed. (deadboot): Don't test it. Instead, use ports calls to check if there are no other live ports. (trivfs_goaway): Don't set it. Wed Nov 15 19:40:44 1995 Roland McGrath * hashexec.c (user_port): Fixed port selection logic. (check_hashbang): Fixed PATH searching in script name guessing. Mon Nov 13 15:11:37 1995 Roland McGrath * exec.c (S_exec_startup): Compatibility RPC removed. * exec.c (load_section): Catch faults while zeroing partial bss page. Sun Nov 5 00:15:07 1995 Miles Bader * main.c (main): Add flags arg to trivfs_startup call. Wed Oct 25 15:50:38 1995 Roland McGrath * exec.c (S_exec_startup_get_info): New function, modified from S_exec_startup. (S_exec_startup): Just call it. * main.c (exec_demuxer): Call exec_startup_server. Tue Oct 24 19:21:20 1995 Roland McGrath * Makefile (OBJS): Add exec_startupServer.o. * priv.h (struct bootinfo): Use vm_size_t for phdr_size. Wed Oct 18 18:36:30 1995 Roland McGrath * hashexec.c (check_hashbang: prepare_args): Enable and clean up code to guess the name of the script before resorting to /dev/fd. Wed Oct 18 03:05:05 1995 Roland McGrath * hashexec.c: New file. * exec.c (struct execdata): Moved to priv.h. (std_*, finish): Make global. (do_exec): Only reset CWDIR when null, even if secure. Actually call check_hashbang and return success if it does. Use new hurd_file_name_lookup protocol with private callbacks to open interpreter file on behalf of client. Remove `bootout' label; use `stdout' or `out' as appropriate instead. At `out' label always deref BOOT, which cleans it up iff necessary. (S_exec_exec): #if 0 out $EXECSERVERS processing for time being. * priv.h: Added some #includes. (struct execdata): Moved here from exec.c. (std_*): Declare these. (finish, check_hashbang): Declare them. * Makefile (SRCS, OBJS): Add hashexec.[co]. (DIST_FILES): Remove it from here. Wed Oct 11 01:45:32 1995 Roland McGrath * main.c, priv.h, execmutations.h: New files. * exec.c: Server mechanics removed; now uses libtrivfs/libports. Main program split out into main.c. (std_lock): New variable (rwlock). (do_exec): Acquire reader lock to access std_ints and std_ports. (S_exec_setexecdata): Acquire writer lock to change them. * Makefile (OBJS): Add main.o; remove fsysServer.o, notifyServer.o. (LCLHDRS): Add priv.h and execmutations.h. (exec-MIGSFLAGS): New variable. (exec): Depend on livtrivfs, libthreads, libshouldbeinlibc. Mon Oct 2 10:33:14 1995 Michael I. Bushnell, p/BSG * exec.c (do_exec): Doc fix. Wed Sep 27 11:21:19 1995 Roland McGrath * exec.c (do_exec): Don't set NEWTASK's bootstrap port until after we have finished completely with OLDTASK. (do_mach_notify_no_senders): Remove bogus mod_refs call on receive_portset. Wed Sep 20 19:57:55 1995 Roland McGrath * exec.c (struct bootinfo): New members `phdr_addr', `phdr_size', `user_entry'. (do_exec): Set them. Code rearranged to construct bootinfo before looking up interpreter file, keep proper track of port rights and VM copied into bootinfo (there were leaks). Sat Sep 16 13:15:42 1995 Roland McGrath * Makefile: Remove vpath directive. Fri Sep 8 17:50:03 1995 Roland McGrath * Makefile (OTHERLIBS, CPPFLAGS): Disable bfd by default. Mon Aug 28 16:57:14 1995 Roland McGrath * exec.c (S_fsys_forward): New stub function. Sun Jul 30 23:49:49 1995 Michael I. Bushnell, p/BSG * Makefile (SRCS): Added unzip.c, util.c, and inflate.c. Thu Jul 6 15:32:39 1995 Michael I Bushnell * hostarch.c (bfd_mach_host_arch_mach): Remove assignment from inside if test. * Makefile: Removed dependencies that are now automatically generated. Wed Jul 5 18:00:49 1995 Michael I Bushnell * Makefile (OTHERLIBS): Define var. (all, exec): Delete targets. Tue Jun 27 11:48:08 1995 Michael I Bushnell * exec.c (load_section): Remove assignments from if tests. (map): Likewise. (prepare): Likewise. (load): Likewise. (servercopy): Likewise. (do_exec): Likewise. (S_exec_setexecdata): Likewise. (S_exec_exec): Put extra parens around assignment inside while test. Thu Jun 8 02:57:28 1995 Roland McGrath * exec.c (struct execdata.info.elf): Add members `anywhere' and `loadbase'. (load_section): Use them; if `anywhere' set, load the section anywhere. Record load address in `loadbase'. (check_elf): Initialize `anywhere' and `loadbase'. (postload): Merged into load. (load): Perform postload functionality here, after calling finish_mapping. (finish): Take new flag arg; deallocate file port only if set. (do_exec): Pass flag to finish appropriately. Don't call finish_mapping and postload after load. KLUDGE: Load the interpreter before the program instead of after. Mon Jun 5 06:42:33 1995 Roland McGrath * exec.c: Majorly revamped: Now supports the ELF format directly. Secondarily uses the BFD library #ifdef BFD. Supports gunzipping only #ifdef GZIP. * hostarch.c: Rewritten to unconditionally return both BFD and ELF machine types. Fri May 12 18:59:21 1995 Miles Bader * exec.c (S_fsys_set_options, S_fsys_mod_readonly): Change from mod_readonly to set_options. Thu Apr 20 22:14:47 1995 Roland McGrath * exec.c (check_gzip): Rewind the stream before calling `get_method'. Open a new BFD on the uncompressed data stream before return. Sun Apr 9 01:27:10 1995 Roland McGrath * exec.c (struct execdata) [BFD]: New member `interp_section'. (check_section): Notice section named ".interp" and set that pointer. (load_section): Do nothing if the section is zero size. When reading into our copy of the overlap page, don't read past the end of the section. (do_exec): Consolidate new subfunction `check_maybe_gzip'. If there is an interpreter section, load the interpreter file too, and use its entry point instead of the user program's. Cleaned up and made more robust deallocation of BOOT info on error. (deadboot): New function, split out of do_mach_port_notify_no_senders. * Makefile (vpath lib%.a): Add search path. (exec): Depend on -lbfd and -liberty. (CPPFLAGS): Append -DBFD; omit -DA_OUT_H=... (bfdexec): Target removed. * exec.c (load_section): fseek to desired position before freading. (input_room): Always map a page-aligned region. Thu Feb 9 01:01:57 1995 Roland McGrath * exec.c (check_section): Don't check SEC_RELOC flag. Wed Feb 8 19:48:11 1995 Michael I Bushnell * exec.c (load_section) [BFD]: BFD does not set SEC_HAS_CONTENTS on a.out BSS's ever; don't make zeroing of bss conditional on that. It's not clear exactly what SEC_HAS_CONTENTS is for anyhow; perhaps the Right Thing is to set in on BSS. In any case, don't depend on this flag here. Sat Jan 28 17:08:02 1995 Roland McGrath * exec.c (prepare): Give the stream a seek function. Sun Jan 22 03:16:17 1995 Roland McGrath * exec.c: Update BFD code; it works now. * hostarch.c [BFD]: Fix prototype. Thu Jan 19 01:24:18 1995 Roland McGrath * hostarch.c: Add case for CPU_TYPE_ALPHA. * hostarch.c (bfd_mach_host_arch_mach, aout_mach_host_machine): Use mach_msg_type_number_t instead of unsigned int. Cast &HOSTINFO to (natural_t *). Sun Jan 15 06:29:56 1995 Roland McGrath * exec.c [BFD] (bfd_mach_host_arch_mach): In decl, MACHINE arg is `long int *' now. [BFD] (host_bfd_arch_info): New variable. [BFD] (host_bfd): Initialize `arch_info' member to its address. (check) [BFD]: Use bfd_arch_get_compatible properly, rather than the nonexistent bfd_arch_compatible. (main) [BFD]: Fill in host_bfd.arch_info instead of old `obj_machine' and `obj_archiecture' members, which BFD no longer has. * hostarch.c [BFD] (bfd_mach_host_arch_mach): MACHINE arg is `long int *' now. Tue Dec 13 23:28:08 1994 Roland McGrath * Makefile (OBJS): Add unzip.o util.o inflate.o. (LCLHDRS): Add gzip.h crypt.h tailor.h. (unzip.o util.o inflate.o): Depend on those. (CFLAGS): Use +=. * inflate.c, unzip.c, util.c, tailor.h, gzip.h, crypt.h: New files. Sun Dec 11 19:49:01 1994 Roland McGrath * exec.c (struct execdata): New members `headbuf', `file_data', `optimal_block'. (load_section): Copy data from U->file_data if that is nonnull. Use new subfunction `write_to_task' that handles non-page aligned sections. (input_room): Fix EOF check. Use io_read if no memory object. (prepare): New function, broken out of check. Initialize E->file_data and E->optimal_block. Set E->stream.__seen bit. (check): No longer take FILE arg. Use E->file_data if nonnull; else read from stream if no memory object. (finish_mapping): Reset members after deallocating resources. (finish): Likewise. Call fclose. Don't deallocate E->header if it points to &E->headbuf or E->file_data. (check_gzip): New function, implements executing gzip'd binaries. (do_exec): Call prepare before check. Call check_gzip if file format unrecognized. Wed Nov 9 01:40:28 1994 Michael I Bushnell * exec.c (set_active_trans): Don't deallocate EXECNODE here to work around a ufs bug. * exec.c: Include and . (set_active_trans): New function. (S_exec_init): Call set_active_trans. Wed Aug 31 11:16:04 1994 Michael I Bushnell * exec.c (load_section): Pass address of stream in call to fread. (input_room): Cast second arg to vm_deallocate. Dereference F in setting __error member. (close_exec_stream): Provide all three args to vm_deallocate and cast the second one properly. Wed Aug 31 04:32:26 1994 Roland McGrath * exec.c (do_exec): Do check before task_suspend. #if 0'd out: If check gets ENOEXEC, call check_hashbang. (struct execdata): Move member `stream' outside of [BFD]. (load_section): Use fread instead of hand mapping and copying unconditionally (was [BFD]); old code left #if'd out. (close_exec_stream): Renamed from close_stdio_bfd; moved out of [BFD]. (input_room): Define unconditionally, not [BFD]. (check): Set up E->stream unconditionally. Tue Aug 30 11:58:27 1994 Michael I Bushnell * exec.c (S_fsys_syncfs, S_fsys_mod_readonly): New stubs. * exec.c (set_init_port): Use new authentication protocol. * exec.c (S_exec_exec): Call hurd_file_name_lookup instead of hurd_path_lookup. * exec.c (S_fsys_getroot): Return FS_RETRY_NORMAL instead of FS_RETRY_NONE. * exec.c (procserver): New global variable. (S_exec_init): Set procserver. (do_exec): Use `procserver' instead of USEPORT macro. (S_exec_init): Likewise. Mon Aug 29 13:08:44 1994 Michael I Bushnell * exec.c (do_exec): Enable and fix up code for doing proc_reassign in the EXEC_NEWTASK case. (do_exec): If we don't provide the proc port, and this is a newtask exec, then use the proc port to fetch a new one corresponding to the new task. Wed Aug 17 14:59:58 1994 Michael I Bushnell * exec.c (S_exec_exec): Bother to pass flags to do_exec. * exec.c (essentialstartupport, essentialhostport): Deleted vars. (S_exec_init): Do startup_essential_task here like before, but make sure we do it last. (S_exec_setexecdata): Don't do startup_essential_task here. Tue Aug 16 10:02:50 1994 Michael I Bushnell * exec.c (set_init_port): Don't assume that MACH_PORT_NULL == 0. (do_exec): Likewise. Mon Aug 15 21:23:13 1994 Roland McGrath * exec.c: Include for getpid decl. (set_init_port): Use pid_t for PID. (S_exec_init): Pass poly arg to proc_execdata_notify. Mon Aug 15 15:24:45 1994 Michael I Bushnell * exec.c (do_exec): Finish implementing EXEC_SECURE flag; implement EXEC_DEFAULTS flag. (S_exec_init): Delay startup_essential_task until after we've received the first essential ports from the proc server. (essentialstartupport essentialhostport): New global vars. Fri Jul 22 10:21:30 1994 Michael I Bushnell * Makefile: Rewritten in accord with new scheme. * exec.c: Include "exec_S.h" instead of "exec_server.h". Include "notify_S.h". Tue Jul 19 20:51:58 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * Makefile (exec_server.h execServer.c, fsys_S.h fsysServer.c): Find .defs file in ../hurd, not $(includedir). Tue Jul 19 12:42:32 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) * exec.c (S_fsys_getroot): New arg `dotdot'; don't do anything with it. (S_fsys_startup): Removed dotdot args. (main): Deleted var `dotdot'; don't expect it from fsys_startup. * Makefile (exec): Don't use variable $(link) anymore. Tue Jul 5 14:20:15 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) * Makefile (SRCS, TAGSHDRS): New variables. Fri Jun 24 14:42:59 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) * exec.c (load_section) [AOUT, mapstart > addr]: Dereference U->header in use of N_MAGIC. Fri Jun 24 02:40:32 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * exec.c (load_section): Store protection of section in new local VM_PROT. If vm_write of overlap page gets KERN_PROTECTION_FAILURE, change protection of overlap page long enough to write it. [AOUT]: Return ENOEXEC if there is overlap in NMAGIC or ZMAGIC. Thu Jun 16 16:15:17 1994 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) * exec.c (S_fsys_getroot): Implement new fsys_getroot interface. Mon Jun 13 04:06:24 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu) * exec.c (check): Store FILE in E->file. Tue May 31 17:20:24 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu) * a.out.h (struct exec): Type removed. (OMAGIC, NMAGIC, ZMAGIC, N_MAGIC, N_MACHTYPE, N_BADMAG): Macros removed. Just #include "a.out.gnu.h" to get all these defined. (N_TXTLEN, N_TXTOFF): Use N_MAGIC instead of a_magic member. * Makefile (DIST_FILES): Add a.out.gnu.h. (exec.o, hostarch.o): Depend on a.out.gnu.h. Fri May 27 01:40:04 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * exec.c (servercopy): New function to check the servercopy flag and possibly vm_allocate a copy of argument data. (do_exec): Take new args DTABLE_COPY, PORTARRAY_COPY, INTARRAY_COPY. Use servercopy for ARGV, ENVP, DTABLE, PORTARRAY, and INTARRAY. (S_exec_exec): Take those new args and pass them to do_exec. (S_exec_setexecdata): Take new args PORTS_COPY and INTS_COPY. Use servercopy for PORTS and INTS. (S_exec_startup): Never copy from info in *BOOT, always just set the argument pointers to the pointers in *BOOT. MiG will copy and deallocate the space as necessary. * exec.c (check): Lock and unlock E->cntl->lock properly. (finish_mapping): New function, broken out of finish. (postload_section): New function, broken out of load_section. (postload): New function, like load but calls postload_section. (do_exec): Call finish_mapping and postload between load and finish. Tue May 24 19:49:16 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * exec.c (S_exec_exec): Use strsep instead of strtok. (main): Keep looping after error from mach_msg_server. Tue May 24 14:22:16 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) * exec.c (load_section): Cast arg to vm_deallocate properly. Tue May 24 01:05:08 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * exec.c (struct bootinfo): Remove members argv_vmalloc, envp_vmalloc. (do_exec): Don't set BOOT->argv_vmalloc or BOOT->envp_vmalloc. If ARGV_COPY is set, vm_allocate space for ARGV; likewise for ENVP_COPY and ENVP. (S_exec_startup): Don't test BOOT->argv_vmalloc and BOOT->envp_vmalloc; BOOT->argv and BOOT->envp are always vm_allocate'd. (do_mach_notify_no_senders): Likewise. (load_section): Handle non-bss sections that are not page aligned. Mon May 23 22:01:11 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * exec.c (S_exec_exec): Reverse args to memmem. (do_exec): Don't vm_deallocate DEALLOCNAMES or DESTROYNAMES; mig deallocates the space for us. Tue May 17 13:33:41 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) * exec.c (S_exec_init): Don't deallocate host_priv until after we've used it in the call to startup_essential_task. Thu May 12 03:53:57 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * exec.c (S_fsys_init): Add reply port args. Wed May 11 16:03:07 1994 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) * exec.c (S_exec_init): Spelling fix. * Makefile (exec.o): Add dependencies on fsys_S.h and notify_S.h. (fsysServer.c, notifyServer.c): Notice that these rules build fsys_S.h and notify_S.h respectively. Mon May 9 17:06:52 1994 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) * exec.c (exec_version, save_argv): New variable. (main): Set save_argv. (S_exec_init): Give the real argv to proc. Call proc_register_version if we can. (S_exec_init): Call startup_essential_task if we can. Thu May 5 06:25:02 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * Makefile: Change uses of $(headers) to $(includedir). * exec.c: Change return type of all RPC server functions to kern_return_t. error_t is not compatible with the declarations in the mig-generated header files. * exec.c (do_exec): Set BOOT->stack_base and BOOT->stack_size with mach_setup_thread. (S_exec_exec): Pass msg type arg for FILE arg to exec_exec. Thu Dec 23 18:05:04 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * exec.c (do_exec): For a newtask exec when EXEC_SECURE is not set and OLDTASK is not null, send the `task_create' RPC on OLDTASK rather than mach_task_self ().