Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Oct 1996 09:43:33 -0700
From:      John Polstra <jdp@polstra.com>
To:        msmith@atrad.adelaide.edu.au
Cc:        hackers@freebsd.org, sos@freebsd.org
Subject:   Re: Linux compat issue(s)
Message-ID:  <199610151643.JAA03974@austin.polstra.com>
In-Reply-To: <199610150917.SAA21553@genesis.atrad.adelaide.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
> Should I assume that this is the "what static ELF binary is this"
> problem?
> 
> Is anyone working on this, or should I try for a fix?  Any further
> suggestions beyond those raised in the discussions a while back?
> JDP?

Yeah, I said I was going to do something about this, and then I dropped
the ball.  Sorry.  GNU binutils is so damned frustrating to work with, I
just had to get away from it for a while.

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).
> 
> There has been some talk between the various free groups, but there
> has been no consensus yet, and I dont see the ELF std being rewritten
> just because we say its faulty.  So ELF is like the plaque, there
> is no current cure :)

ELF _does_ have a mechanism for doing what we want.  Quoting from the
"Program Header" section of the spec:

    Note Section

    Sometimes a vendor or system builder needs to mark an object file
    with special information that other programs will check for
    conformance, compatibility, etc.  Sections of type SHT_NOTE and
    program header elements of type PT_NOTE can be used for this
    purpose.

I still think this is the way to go.  I played around with it a
little bit, and got it sort of limping along.  The ELF linker in
binutils allows you to add a Note section to the program header
without modifying any code in the linker, by using a custom linker
script.  But that feature is buggy as hell, and its only diagnostic
seems to be "core dumped".  I did finally get it to put the Note section
in properly.  But I concluded that the linker script mechanism wasn't
flexible enough for our purposes.  The linker itself would have to be
modified somewhat.  I think that was around the time I contracted a
severe case of GNU spaghetti indigestion, which left me unable to even
glance at the binutils code without breaking out into a cold sweat.
(The symptoms linger to this day.)  [He pops another Valium ... :-]

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.

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?199610151643.JAA03974>