From owner-freebsd-hackers Tue Oct 15 11:17:53 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA25748 for hackers-outgoing; Tue, 15 Oct 1996 11:17:53 -0700 (PDT) Received: from SandBox.CyberCity.dk (disn5.cybercity.dk [194.16.57.5]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id LAA25701; Tue, 15 Oct 1996 11:16:16 -0700 (PDT) Received: (from sos@localhost) by SandBox.CyberCity.dk (8.7.6/8.7.3) id UAA01759; Tue, 15 Oct 1996 20:16:41 +0200 (MET DST) Message-Id: <199610151816.UAA01759@SandBox.CyberCity.dk> Subject: Re: Linux compat issue(s) To: jdp@polstra.com (John Polstra) Date: Tue, 15 Oct 1996 20:16:41 +0200 (MET DST) From: "Soren Schmidt" Cc: msmith@atrad.adelaide.edu.au, hackers@freebsd.org, sos@freebsd.org In-Reply-To: <199610151643.JAA03974@austin.polstra.com> from "John Polstra" at Oct 15, 96 09:43:33 am From: sos@freebsd.org Reply-to: sos@freebsd.org X-Mailer: ELM [version 2.4 PL25 ME8b] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In reply to John Polstra who wrote: > > I still don't agree with Soren: > > > ... ELF is > > only supposed to handle ONE os type per platform, what we are doing > > is blasfemy (ie not running SVR4). [stuff deleted] > The Note section idea also doesn't solve the entire problem. We could > mark our own FreeBSD ELF files with Note sections, so we could recognize > them. But unless we could persuade the Linux people to do likewise, we'd > still be unable to distinguish between Linux ELF files and SVR4 ELF files. > This is going to be a problem no matter what we do, though. So, you agree with me after all :) Its not even enough to distinguish between Linux/FreeBSD (which we could with note sections) and the rest, we will eventually have to be able to tell Solaris/DGUX/Olivetti-SVR4/NCR-SVR4/whatnot from each other too, or we will be in hell anyway. I know for a fact that if we are going to do SVR4 emulation we will NEED a way to tell them apart. So having a nice little util that marks the ELF header in ways for us to know is the ONLY solution to this problem, like it or not. I propose that we use some unused space in the ELF header. The ELF header starts with a 16byte char field, where only the first 8 are used in all the ELF/i386 incarnations I've seen, so we can put a 8 char text here for the platform (that can easily be seen with the file(1) cmd too). Simple, easy, nice hack, works.... -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Søren Schmidt (sos@FreeBSD.org) FreeBSD Core Team Even more code to hack -- will it ever end ..