From owner-freebsd-hackers Wed Oct 16 20:25:23 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id UAA28795 for hackers-outgoing; Wed, 16 Oct 1996 20:25:23 -0700 (PDT) Received: from lestat.nas.nasa.gov (lestat.nas.nasa.gov [129.99.50.29]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id UAA28788; Wed, 16 Oct 1996 20:25:20 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lestat.nas.nasa.gov (8.7.5/8.6.12) with SMTP id UAA25575; Wed, 16 Oct 1996 20:13:36 -0700 (PDT) Message-Id: <199610170313.UAA25575@lestat.nas.nasa.gov> X-Authentication-Warning: lestat.nas.nasa.gov: Host localhost [127.0.0.1] didn't use HELO protocol To: Michael Smith Cc: sos@freebsd.org, jdp@polstra.com, hackers@freebsd.org Subject: Re: Linux compat issue(s) Reply-To: Jason Thorpe From: Jason Thorpe Date: Wed, 16 Oct 1996 20:13:36 -0700 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Thu, 17 Oct 1996 11:59:44 +0930 (CST) Michael Smith wrote: > Ok, "modulo the usual Linux crap". Note that the path-detecting code > probably wants to understand /compat/netbsd, which hadn't occurred to me > before. NetBSD does this ... /emul/freebsd :-) > NetBSD people lurking - is there a reliable way to discriminate a static > NetBSD ELF i386 binary from any other static i386 ELF binary? Not that I know of, no. The last time I discussed this issue with Linus (hmm, I think I saved the thread somewhere...), he seemed to think that the best way to deal with that was to make the BSD ABIs match Linux. I.e. he didn't seem to care to much that it was a problem. One of this suggestions was to watch for the first call to sbrk(2), since "many" (his word) Linux crt0.o's do this before any other system calls. "Matching ABIs" is a particular problem for NetBSD, of course, because the system call switch, errno values, stat structures, etc. a different for all of Linux's supported architectures. "Whatever." After a week-long e-mail exchange, nothing really useful came out of it at all... Two ideas were discussed among the NetBSD developers: (1) Use some of the unused bytes at the end of e_ident[]. I.e. have something like: \177 E L F N B S D If some OS chooses not to look at the entire e_ident[] field, well, tough :-) (2) Use a special notes section. I think we pretty much settled on (1), since it's possible to strip out all of the section headers, and still have a runnable executable. (I think; correct me if I'm wrong. :-) (The thread was mostly about "So, now that NetBSD/alpha is switching to ELF64, how can we find a sane way to differentiate between NetBSD/alpha and Linux/alpha ELF64 executables...) Jason R. Thorpe thorpej@nas.nasa.gov NASA Ames Research Center Home: 408.866.1912 NAS: M/S 258-6 Work: 415.604.0935 Moffett Field, CA 94035 Pager: 415.428.6939