Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Oct 1996 17:11:26 -0700
From:      John Polstra <jdp@polstra.com>
To:        sos@freebsd.org
Cc:        hackers@freebsd.org
Subject:   Re: Linux compat issue(s) 
Message-ID:  <199610160011.RAA08338@austin.polstra.com>
In-Reply-To: Your message of "Tue, 15 Oct 1996 20:16:41 %2B0200." <199610151816.UAA01759@SandBox.CyberCity.dk> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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 :)

:-)  I don't even know any more whether I "agree" with you.  I guess I
just have a slightly different perspective.

However, I must admit that you are beginning to swing me over to your
point of view ...

> 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.

Yes.

> 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 like this idea.  We can't expect foreign files to arrive in a
recognizable state, so we need to be able to "brand" them ourselves.
The utility should also be able to "unbrand" a file, returning it to its
original form.

> 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....

This is the kind of hack that I've argued against all along.  But I
suppose it may be the only choice, if we want to be able to brand an
existing file.  We can't use my Note section idea, because adding a
header to the program header part of the file shifts everything else
down in the file, changes the addresses of things in the program, and
so forth.  It would be easy to add it in the link phase, but we are not
reasonably going to be able to control the link phase.

It _is_ starting to sound like I agree with you, isn't it? :-)

John
--
   John Polstra                                       jdp@polstra.com
   John D. Polstra & Co., Inc.                Seattle, Washington USA
   "Self-knowledge is always bad news."                 -- John Barth



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610160011.RAA08338>