19454b2d8SWarner Losh /*- 28a36da99SPedro F. Giffuni * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 38a36da99SPedro F. Giffuni * 4cfefd687SGarrett Wollman * Copyright (c) 1993, David Greenman 5cfefd687SGarrett Wollman * All rights reserved. 6cfefd687SGarrett Wollman * 7cfefd687SGarrett Wollman * Redistribution and use in source and binary forms, with or without 8cfefd687SGarrett Wollman * modification, are permitted provided that the following conditions 9cfefd687SGarrett Wollman * are met: 10cfefd687SGarrett Wollman * 1. Redistributions of source code must retain the above copyright 11cfefd687SGarrett Wollman * notice, this list of conditions and the following disclaimer. 12cfefd687SGarrett Wollman * 2. Redistributions in binary form must reproduce the above copyright 13cfefd687SGarrett Wollman * notice, this list of conditions and the following disclaimer in the 14cfefd687SGarrett Wollman * documentation and/or other materials provided with the distribution. 15cfefd687SGarrett Wollman * 16cfefd687SGarrett Wollman * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17cfefd687SGarrett Wollman * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18cfefd687SGarrett Wollman * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 191984b014SDavid Greenman * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20cfefd687SGarrett Wollman * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21cfefd687SGarrett Wollman * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22cfefd687SGarrett Wollman * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23cfefd687SGarrett Wollman * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24cfefd687SGarrett Wollman * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25cfefd687SGarrett Wollman * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26cfefd687SGarrett Wollman * SUCH DAMAGE. 27cfefd687SGarrett Wollman */ 28cfefd687SGarrett Wollman 29677b542eSDavid E. O'Brien #include <sys/cdefs.h> 30677b542eSDavid E. O'Brien __FBSDID("$FreeBSD$"); 31677b542eSDavid E. O'Brien 3226f9a767SRodney W. Grimes #include <sys/param.h> 3326f9a767SRodney W. Grimes #include <sys/exec.h> 3426f9a767SRodney W. Grimes #include <sys/imgact.h> 35bc6d7444SDavid Greenman #include <sys/imgact_aout.h> 3626f9a767SRodney W. Grimes #include <sys/kernel.h> 377332c129SKonstantin Belousov #include <sys/limits.h> 38fb919e4dSMark Murray #include <sys/lock.h> 39e5d6cd0cSBruce Evans #include <sys/malloc.h> 40fb919e4dSMark Murray #include <sys/mutex.h> 41a794e791SBruce Evans #include <sys/proc.h> 421ba5ad42SEdward Tomasz Napierala #include <sys/racct.h> 43fb919e4dSMark Murray #include <sys/resourcevar.h> 4422d4b0fbSJohn Polstra #include <sys/signalvar.h> 4522d4b0fbSJohn Polstra #include <sys/syscall.h> 46e5d6cd0cSBruce Evans #include <sys/sysent.h> 47e5d6cd0cSBruce Evans #include <sys/systm.h> 48a794e791SBruce Evans #include <sys/vnode.h> 49fb919e4dSMark Murray 50710ded3aSPeter Wemm #include <machine/frame.h> 51e5d6cd0cSBruce Evans #include <machine/md_var.h> 52cfefd687SGarrett Wollman 5326f9a767SRodney W. Grimes #include <vm/vm.h> 54efeaf95aSDavid Greenman #include <vm/pmap.h> 55efeaf95aSDavid Greenman #include <vm/vm_map.h> 561616db3cSJohn Dyson #include <vm/vm_object.h> 57e5d6cd0cSBruce Evans #include <vm/vm_param.h> 58cfefd687SGarrett Wollman 597332c129SKonstantin Belousov #ifdef __amd64__ 607332c129SKonstantin Belousov #include <compat/freebsd32/freebsd32_signal.h> 617332c129SKonstantin Belousov #include <compat/freebsd32/freebsd32_util.h> 627332c129SKonstantin Belousov #include <compat/freebsd32/freebsd32_proto.h> 637332c129SKonstantin Belousov #include <compat/freebsd32/freebsd32_syscall.h> 647332c129SKonstantin Belousov #include <compat/ia32/ia32_signal.h> 657332c129SKonstantin Belousov #endif 667332c129SKonstantin Belousov 674d77a549SAlfred Perlstein static int exec_aout_imgact(struct image_params *imgp); 6831174518SJohn Baldwin static int aout_fixup(uintptr_t *stack_base, struct image_params *imgp); 697ee050b7SBruce Evans 70d86c1f0dSKonstantin Belousov #define AOUT32_USRSTACK 0xbfc00000 71d86c1f0dSKonstantin Belousov 727332c129SKonstantin Belousov #if defined(__i386__) 73d86c1f0dSKonstantin Belousov 74d86c1f0dSKonstantin Belousov #define AOUT32_PS_STRINGS (AOUT32_USRSTACK - sizeof(struct ps_strings)) 75d86c1f0dSKonstantin Belousov 7622d4b0fbSJohn Polstra struct sysentvec aout_sysvec = { 77a8d403e1SKonstantin Belousov .sv_size = SYS_MAXSYSCALL, 78a8d403e1SKonstantin Belousov .sv_table = sysent, 79a8d403e1SKonstantin Belousov .sv_transtrap = NULL, 80a8d403e1SKonstantin Belousov .sv_fixup = aout_fixup, 81a8d403e1SKonstantin Belousov .sv_sendsig = sendsig, 82a8d403e1SKonstantin Belousov .sv_sigcode = sigcode, 83a8d403e1SKonstantin Belousov .sv_szsigcode = &szsigcode, 84a8d403e1SKonstantin Belousov .sv_name = "FreeBSD a.out", 85a8d403e1SKonstantin Belousov .sv_coredump = NULL, 86a8d403e1SKonstantin Belousov .sv_imgact_try = NULL, 87a8d403e1SKonstantin Belousov .sv_minsigstksz = MINSIGSTKSZ, 88a8d403e1SKonstantin Belousov .sv_minuser = VM_MIN_ADDRESS, 89d86c1f0dSKonstantin Belousov .sv_maxuser = AOUT32_USRSTACK, 90d86c1f0dSKonstantin Belousov .sv_usrstack = AOUT32_USRSTACK, 91d86c1f0dSKonstantin Belousov .sv_psstrings = AOUT32_PS_STRINGS, 92a8d403e1SKonstantin Belousov .sv_stackprot = VM_PROT_ALL, 93a8d403e1SKonstantin Belousov .sv_copyout_strings = exec_copyout_strings, 94a8d403e1SKonstantin Belousov .sv_setregs = exec_setregs, 95a8d403e1SKonstantin Belousov .sv_fixlimit = NULL, 96b4cf0e62SKonstantin Belousov .sv_maxssiz = NULL, 977332c129SKonstantin Belousov .sv_flags = SV_ABI_FREEBSD | SV_AOUT | SV_IA32 | SV_ILP32, 98afe1a688SKonstantin Belousov .sv_set_syscall_retval = cpu_set_syscall_retval, 99afe1a688SKonstantin Belousov .sv_fetch_syscall_args = cpu_fetch_syscall_args, 100afe1a688SKonstantin Belousov .sv_syscallnames = syscallnames, 101e5d81ef1SDmitry Chagin .sv_schedtail = NULL, 10291d1786fSDmitry Chagin .sv_thread_detach = NULL, 103038c7205SDmitry Chagin .sv_trap = NULL, 104*28a66fc3SKonstantin Belousov .sv_onexec_old = exec_onexec_old, 105*28a66fc3SKonstantin Belousov .sv_onexit = exit_onexit, 10622d4b0fbSJohn Polstra }; 10722d4b0fbSJohn Polstra 1087332c129SKonstantin Belousov #elif defined(__amd64__) 1097332c129SKonstantin Belousov 1107332c129SKonstantin Belousov #define AOUT32_PS_STRINGS \ 1117332c129SKonstantin Belousov (AOUT32_USRSTACK - sizeof(struct freebsd32_ps_strings)) 112481af8b9SKonstantin Belousov #define AOUT32_MINUSER FREEBSD32_MINUSER 1137332c129SKonstantin Belousov 1147332c129SKonstantin Belousov extern const char *freebsd32_syscallnames[]; 1157332c129SKonstantin Belousov extern u_long ia32_maxssiz; 1167332c129SKonstantin Belousov 1177332c129SKonstantin Belousov struct sysentvec aout_sysvec = { 1187332c129SKonstantin Belousov .sv_size = FREEBSD32_SYS_MAXSYSCALL, 1197332c129SKonstantin Belousov .sv_table = freebsd32_sysent, 1207332c129SKonstantin Belousov .sv_transtrap = NULL, 1217332c129SKonstantin Belousov .sv_fixup = aout_fixup, 1227332c129SKonstantin Belousov .sv_sendsig = ia32_sendsig, 1237332c129SKonstantin Belousov .sv_sigcode = ia32_sigcode, 1247332c129SKonstantin Belousov .sv_szsigcode = &sz_ia32_sigcode, 1257332c129SKonstantin Belousov .sv_name = "FreeBSD a.out", 1267332c129SKonstantin Belousov .sv_coredump = NULL, 1277332c129SKonstantin Belousov .sv_imgact_try = NULL, 1287332c129SKonstantin Belousov .sv_minsigstksz = MINSIGSTKSZ, 129481af8b9SKonstantin Belousov .sv_minuser = AOUT32_MINUSER, 1307332c129SKonstantin Belousov .sv_maxuser = AOUT32_USRSTACK, 1317332c129SKonstantin Belousov .sv_usrstack = AOUT32_USRSTACK, 1327332c129SKonstantin Belousov .sv_psstrings = AOUT32_PS_STRINGS, 1337332c129SKonstantin Belousov .sv_stackprot = VM_PROT_ALL, 1347332c129SKonstantin Belousov .sv_copyout_strings = freebsd32_copyout_strings, 1357332c129SKonstantin Belousov .sv_setregs = ia32_setregs, 1367332c129SKonstantin Belousov .sv_fixlimit = ia32_fixlimit, 1377332c129SKonstantin Belousov .sv_maxssiz = &ia32_maxssiz, 1387332c129SKonstantin Belousov .sv_flags = SV_ABI_FREEBSD | SV_AOUT | SV_IA32 | SV_ILP32, 1397332c129SKonstantin Belousov .sv_set_syscall_retval = ia32_set_syscall_retval, 1407332c129SKonstantin Belousov .sv_fetch_syscall_args = ia32_fetch_syscall_args, 1417332c129SKonstantin Belousov .sv_syscallnames = freebsd32_syscallnames, 142*28a66fc3SKonstantin Belousov .sv_onexec_old = exec_onexec_old, 143*28a66fc3SKonstantin Belousov .sv_onexit = exit_onexit, 1447332c129SKonstantin Belousov }; 1457332c129SKonstantin Belousov #else 1467332c129SKonstantin Belousov #error "Port me" 1477332c129SKonstantin Belousov #endif 1487332c129SKonstantin Belousov 149b9e91a85SBruce Evans static int 15031174518SJohn Baldwin aout_fixup(uintptr_t *stack_base, struct image_params *imgp) 151f36ba452SJake Burkholder { 152f36ba452SJake Burkholder 15331174518SJohn Baldwin *stack_base -= sizeof(uint32_t); 15431174518SJohn Baldwin if (suword32((void *)*stack_base, imgp->args->argc) != 0) 15531174518SJohn Baldwin return (EFAULT); 15631174518SJohn Baldwin return (0); 157f36ba452SJake Burkholder } 158f36ba452SJake Burkholder 159f36ba452SJake Burkholder static int 1607332c129SKonstantin Belousov exec_aout_imgact(struct image_params *imgp) 161cfefd687SGarrett Wollman { 162e0c95ed9SBruce Evans const struct exec *a_out = (const struct exec *) imgp->image_header; 1635856e12eSJohn Dyson struct vmspace *vmspace; 1642f33b2c0SAlan Cox vm_map_t map; 1651616db3cSJohn Dyson vm_object_t object; 1661616db3cSJohn Dyson vm_offset_t text_end, data_end; 167ede8dc43SBruce Evans unsigned long virtual_offset; 168a316d390SJohn Dyson unsigned long file_offset; 169cfefd687SGarrett Wollman unsigned long bss_size; 170bb56ec4aSPoul-Henning Kamp int error; 171cfefd687SGarrett Wollman 1721e1e0b44SSøren Schmidt /* 1731e1e0b44SSøren Schmidt * Linux and *BSD binaries look very much alike, 1741e1e0b44SSøren Schmidt * only the machine id is different: 175d3628763SRodney W. Grimes * 0x64 for Linux, 0x86 for *BSD, 0x00 for BSDI. 176185dc761SPeter Wemm * NetBSD is in network byte order.. ugh. 1771e1e0b44SSøren Schmidt */ 178f4dc9a40SWarner Losh if (((a_out->a_midmag >> 16) & 0xff) != 0x86 && 179f4dc9a40SWarner Losh ((a_out->a_midmag >> 16) & 0xff) != 0 && 180f4dc9a40SWarner Losh ((((int)ntohl(a_out->a_midmag)) >> 16) & 0xff) != 0x86) 1811e1e0b44SSøren Schmidt return -1; 1821e1e0b44SSøren Schmidt 183cfefd687SGarrett Wollman /* 184cfefd687SGarrett Wollman * Set file/virtual offset based on a.out variant. 185cfefd687SGarrett Wollman * We do two cases: host byte order and network byte order 186cfefd687SGarrett Wollman * (for NetBSD compatibility) 187cfefd687SGarrett Wollman */ 188f4dc9a40SWarner Losh switch ((int)(a_out->a_midmag & 0xffff)) { 189cfefd687SGarrett Wollman case ZMAGIC: 190cfefd687SGarrett Wollman virtual_offset = 0; 191cfefd687SGarrett Wollman if (a_out->a_text) { 192f8845af0SPoul-Henning Kamp file_offset = PAGE_SIZE; 193cfefd687SGarrett Wollman } else { 194cfefd687SGarrett Wollman /* Bill's "screwball mode" */ 195cfefd687SGarrett Wollman file_offset = 0; 196cfefd687SGarrett Wollman } 197cfefd687SGarrett Wollman break; 198cfefd687SGarrett Wollman case QMAGIC: 199f8845af0SPoul-Henning Kamp virtual_offset = PAGE_SIZE; 200cfefd687SGarrett Wollman file_offset = 0; 2014fe88fe6SJohn Polstra /* Pass PS_STRINGS for BSD/OS binaries only. */ 2024fe88fe6SJohn Polstra if (N_GETMID(*a_out) == MID_ZERO) 203397df744SBrooks Davis imgp->ps_strings = (void *)aout_sysvec.sv_psstrings; 204cfefd687SGarrett Wollman break; 205cfefd687SGarrett Wollman default: 206cfefd687SGarrett Wollman /* NetBSD compatibility */ 207f4dc9a40SWarner Losh switch ((int)(ntohl(a_out->a_midmag) & 0xffff)) { 208cfefd687SGarrett Wollman case ZMAGIC: 209cfefd687SGarrett Wollman case QMAGIC: 210f8845af0SPoul-Henning Kamp virtual_offset = PAGE_SIZE; 211cfefd687SGarrett Wollman file_offset = 0; 212cfefd687SGarrett Wollman break; 213cfefd687SGarrett Wollman default: 214cfefd687SGarrett Wollman return (-1); 215cfefd687SGarrett Wollman } 216cfefd687SGarrett Wollman } 217cfefd687SGarrett Wollman 218f8845af0SPoul-Henning Kamp bss_size = roundup(a_out->a_bss, PAGE_SIZE); 219cfefd687SGarrett Wollman 220cfefd687SGarrett Wollman /* 221cfefd687SGarrett Wollman * Check various fields in header for validity/bounds. 222cfefd687SGarrett Wollman */ 223cfefd687SGarrett Wollman if (/* entry point must lay with text region */ 224cfefd687SGarrett Wollman a_out->a_entry < virtual_offset || 225cfefd687SGarrett Wollman a_out->a_entry >= virtual_offset + a_out->a_text || 226cfefd687SGarrett Wollman 227cfefd687SGarrett Wollman /* text and data size must each be page rounded */ 2287332c129SKonstantin Belousov a_out->a_text & PAGE_MASK || a_out->a_data & PAGE_MASK 2297332c129SKonstantin Belousov 2307332c129SKonstantin Belousov #ifdef __amd64__ 2317332c129SKonstantin Belousov || 2327332c129SKonstantin Belousov /* overflows */ 2337332c129SKonstantin Belousov virtual_offset + a_out->a_text + a_out->a_data + bss_size > UINT_MAX 2347332c129SKonstantin Belousov #endif 2357332c129SKonstantin Belousov ) 236cfefd687SGarrett Wollman return (-1); 237cfefd687SGarrett Wollman 238cfefd687SGarrett Wollman /* text + data can't exceed file size */ 239c52007c2SDavid Greenman if (a_out->a_data + a_out->a_text > imgp->attr->va_size) 240cfefd687SGarrett Wollman return (EFAULT); 241cfefd687SGarrett Wollman 242cfefd687SGarrett Wollman /* 243cfefd687SGarrett Wollman * text/data/bss must not exceed limits 244cfefd687SGarrett Wollman */ 24591d5354aSJohn Baldwin PROC_LOCK(imgp->proc); 246cfefd687SGarrett Wollman if (/* text can't exceed maximum text size */ 247cbc89bfbSPaul Saab a_out->a_text > maxtsiz || 248cfefd687SGarrett Wollman 249cfefd687SGarrett Wollman /* data + bss can't exceed rlimit */ 250f6f6d240SMateusz Guzik a_out->a_data + bss_size > lim_cur_proc(imgp->proc, RLIMIT_DATA) || 2511ba5ad42SEdward Tomasz Napierala racct_set(imgp->proc, RACCT_DATA, a_out->a_data + bss_size) != 0) { 25291d5354aSJohn Baldwin PROC_UNLOCK(imgp->proc); 253cfefd687SGarrett Wollman return (ENOMEM); 25491d5354aSJohn Baldwin } 25591d5354aSJohn Baldwin PROC_UNLOCK(imgp->proc); 256cfefd687SGarrett Wollman 257cfefd687SGarrett Wollman /* 25860bb3943SAlan Cox * Avoid a possible deadlock if the current address space is destroyed 25960bb3943SAlan Cox * and that address space maps the locked vnode. In the common case, 26060bb3943SAlan Cox * the locked vnode's v_usecount is decremented but remains greater 26160bb3943SAlan Cox * than zero. Consequently, the vnode lock is not needed by vrele(). 26260bb3943SAlan Cox * However, in cases where the vnode lock is external, such as nullfs, 26360bb3943SAlan Cox * v_usecount may become zero. 26460bb3943SAlan Cox */ 265b249ce48SMateusz Guzik VOP_UNLOCK(imgp->vp); 26660bb3943SAlan Cox 26760bb3943SAlan Cox /* 268cfefd687SGarrett Wollman * Destroy old process VM and create a new one (with a new stack) 269cfefd687SGarrett Wollman */ 27089b57fcfSKonstantin Belousov error = exec_new_vmspace(imgp, &aout_sysvec); 271cfefd687SGarrett Wollman 27278022527SKonstantin Belousov vn_lock(imgp->vp, LK_SHARED | LK_RETRY); 27389b57fcfSKonstantin Belousov if (error) 27489b57fcfSKonstantin Belousov return (error); 27560bb3943SAlan Cox 276cfefd687SGarrett Wollman /* 2775856e12eSJohn Dyson * The vm space can be changed by exec_new_vmspace 2785856e12eSJohn Dyson */ 2795856e12eSJohn Dyson vmspace = imgp->proc->p_vmspace; 2805856e12eSJohn Dyson 2810b2ed1aeSJeff Roberson object = imgp->object; 2822f33b2c0SAlan Cox map = &vmspace->vm_map; 2832f33b2c0SAlan Cox vm_map_lock(map); 2841616db3cSJohn Dyson vm_object_reference(object); 2851616db3cSJohn Dyson 2861616db3cSJohn Dyson text_end = virtual_offset + a_out->a_text; 2870a91231dSAlan Cox error = vm_map_insert(map, object, 2881616db3cSJohn Dyson file_offset, 2891616db3cSJohn Dyson virtual_offset, text_end, 2901616db3cSJohn Dyson VM_PROT_READ | VM_PROT_EXECUTE, VM_PROT_ALL, 29178022527SKonstantin Belousov MAP_COPY_ON_WRITE | MAP_PREFAULT | MAP_VN_EXEC); 2922f33b2c0SAlan Cox if (error) { 2932f33b2c0SAlan Cox vm_map_unlock(map); 29441634e2eSAlan Cox vm_object_deallocate(object); 295cfefd687SGarrett Wollman return (error); 2962f33b2c0SAlan Cox } 29778022527SKonstantin Belousov VOP_SET_TEXT_CHECKED(imgp->vp); 2981616db3cSJohn Dyson data_end = text_end + a_out->a_data; 2991616db3cSJohn Dyson if (a_out->a_data) { 3001616db3cSJohn Dyson vm_object_reference(object); 3010a91231dSAlan Cox error = vm_map_insert(map, object, 3021616db3cSJohn Dyson file_offset + a_out->a_text, 3031616db3cSJohn Dyson text_end, data_end, 3041616db3cSJohn Dyson VM_PROT_ALL, VM_PROT_ALL, 30578022527SKonstantin Belousov MAP_COPY_ON_WRITE | MAP_PREFAULT | MAP_VN_EXEC); 3062f33b2c0SAlan Cox if (error) { 3072f33b2c0SAlan Cox vm_map_unlock(map); 30841634e2eSAlan Cox vm_object_deallocate(object); 3091616db3cSJohn Dyson return (error); 3101616db3cSJohn Dyson } 31178022527SKonstantin Belousov VOP_SET_TEXT_CHECKED(imgp->vp); 3122f33b2c0SAlan Cox } 313cfefd687SGarrett Wollman 3141616db3cSJohn Dyson if (bss_size) { 3150a91231dSAlan Cox error = vm_map_insert(map, NULL, 0, 3161616db3cSJohn Dyson data_end, data_end + bss_size, 3171616db3cSJohn Dyson VM_PROT_ALL, VM_PROT_ALL, 0); 3182f33b2c0SAlan Cox if (error) { 3192f33b2c0SAlan Cox vm_map_unlock(map); 320cfefd687SGarrett Wollman return (error); 32168940ac1SDavid Greenman } 3222f33b2c0SAlan Cox } 3232f33b2c0SAlan Cox vm_map_unlock(map); 324cfefd687SGarrett Wollman 325cfefd687SGarrett Wollman /* Fill in process VM information */ 326cfefd687SGarrett Wollman vmspace->vm_tsize = a_out->a_text >> PAGE_SHIFT; 327cfefd687SGarrett Wollman vmspace->vm_dsize = (a_out->a_data + bss_size) >> PAGE_SHIFT; 3287cd99438SBruce Evans vmspace->vm_taddr = (caddr_t) (uintptr_t) virtual_offset; 3297cd99438SBruce Evans vmspace->vm_daddr = (caddr_t) (uintptr_t) 3307cd99438SBruce Evans (virtual_offset + a_out->a_text); 331cfefd687SGarrett Wollman 332cfefd687SGarrett Wollman /* Fill in image_params */ 333c52007c2SDavid Greenman imgp->interpreted = 0; 334c52007c2SDavid Greenman imgp->entry_addr = a_out->a_entry; 335cfefd687SGarrett Wollman 336c52007c2SDavid Greenman imgp->proc->p_sysent = &aout_sysvec; 337c0e5de7dSDavid Greenman 338cfefd687SGarrett Wollman return (0); 339cfefd687SGarrett Wollman } 34092d91f76SGarrett Wollman 34192d91f76SGarrett Wollman /* 34292d91f76SGarrett Wollman * Tell kern_execve.c about it, with a little help from the linker. 34392d91f76SGarrett Wollman */ 344b7feabf9SEd Maste static struct execsw aout_execsw = { 345b7feabf9SEd Maste .ex_imgact = exec_aout_imgact, 346b7feabf9SEd Maste .ex_name = "a.out" 347b7feabf9SEd Maste }; 348aa855a59SPeter Wemm EXEC_SET(aout, aout_execsw); 349