From owner-freebsd-current Wed May 1 22:52:46 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id WAA22691 for current-outgoing; Wed, 1 May 1996 22:52:46 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id WAA22673 for ; Wed, 1 May 1996 22:52:42 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id PAA30427; Thu, 2 May 1996 15:50:29 +1000 Date: Thu, 2 May 1996 15:50:29 +1000 From: Bruce Evans Message-Id: <199605020550.PAA30427@godzilla.zeta.org.au> To: terry@lambert.org Subject: Re: execve Cc: chuckr@Glue.umd.edu, freebsd-current@freebsd.org, joerg_wunsch@uriah.heep.sax.de Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >The big magic is that we don't have to have another object file >that does: >#ifdef AOUT >static const struct execsw aout_execsw = { exec_aout_imgact, "a.out" }; >#endif >#ifdef ELF >static const struct execsw elf_execsw = { exec_elf_imgact, "ELF" }; >#endif >const struct linker_set execsw_set = { >#ifdef AOUT >#ifdef ELF > 2, >#else > 1, >#endif >#else >#ifdef ELF > 1, >#else > 0, >#endif >#endif > { >#ifdef AOUT > { (caddr_t)&aout_execsw }, >#endif >#ifdef ELF > { (caddr_t)&elf_execsw }, >#endif > NULL > } >}; >To make ELF and AOUT optional (plus #ifdef IBCS2, #ifdef SHELL, >#ifdef GZIP ...). OTOH, it would be easy to change config to emit: static const struct execsw aout_execsw = { exec_aout_imgact, "a.out" }; static const struct execsw elf_execsw = { exec_elf_imgact, "ELF" }; const struct linker_set execsw_set = { 2, { { (caddr_t)&aout_execsw }, { (caddr_t)&elf_execsw }, NULL } }; Bruce