From owner-freebsd-current Thu May 23 13:36:50 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id NAA16786 for current-outgoing; Thu, 23 May 1996 13:36:50 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id NAA16775; Thu, 23 May 1996 13:36:39 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id NAA08230; Thu, 23 May 1996 13:30:01 -0700 From: Terry Lambert Message-Id: <199605232030.NAA08230@phaeton.artisoft.com> Subject: Re: Can't run Linux static ELF binaries? To: jehamby@hamby1.lightside.net (Jake Hamby) Date: Thu, 23 May 1996 13:30:01 -0700 (MST) Cc: sos@FreeBSD.org, current@FreeBSD.org In-Reply-To: <199605231312.GAA00518@hamby1.lightside.net> from "Jake Hamby" at May 23, 96 06:12:06 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > As a kludge, may I suggest that files within the /compat/linux > directory be assumed to be Linux/ELF, and files in /compat/svr4 > be assumed SVR4? Looks like the only statically linked programs > are stuff like ldconfig anyway, which you would want to install > in /compat so as not to conflict with FreeBSD's. A "proper" implementation of an ELF ld.so has it mapping into the memory hole above the 4k 0 page but below the actual program load address (this is, I am convinced, why the SVR4 EABI mandates a high load address. In that event, you can't use the ld.so name in order to get the binary type, even on shared images. You are putting off dealing with the inevitable. As to looking for /compat/xxx directory traversal, there is no way iterate a flag down on lookup as a result of lookup; otherwise, you could easily support forks using POSIX namespace escapes. I have some experimental mods for this, but they significantly impact the lookup mechanism in kern/vfs_lookup.c and in ecery one of the FS specific xxx_lookup routines for namei() processing; the biggest problem is the way the vnode locking is handled as a form of non-counting lock, making relookup() necessary in the first place. The changes are *way* above and beyond the FS changes I submitted; they are intended for support of extended attributes, resource forks and alternate directory name spaces (ie: Unicode file name support). They would incidently allow a flag to propagate down following a lookup without needing it to really be a namespace selector; thus when you traversed the point, the flag would be set, the traversal could complete, and the flag would remain set. It would be more correct (and elegant) to attach an ELF segment identifying the binary type by machine to Linux and FreeBSD binaries... or better, to add a system interface ident to the ELF format (yes, this would be a real format change) that can be ignored by systems that don't support it, but which the GNU tools would produce and set a prereserved flag type for Solaris and UnixWare, seperately. Then hope that Sun and SCO adopted the enhancement, but assuming Sun or SCO if nothing was present. Sean has more input on all of this. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.