Subject: Re: Elf on SPARC?
To: Todd Vierling <tv@pobox.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-toolchain
Date: 11/05/1997 19:46:02
On Wed, 5 Nov 1997 06:48:09 -0500 (EST) 
 Todd Vierling <tv@pobox.com> wrote:

 > Switching to ELF32 would be a nightmare if you were going to try to
 > incorporate Linux or SVR4 compatibility options (the former still being
 > worked on); both use ELF32, and as many have stated here before, ELF32 has
 > no platform identifier to distinguish the various emulations.

We already support SVR4 and Linux Elf executable support in the same kernel
on the i386 port.  A heuristic which works pretty well is used.

It's will be easy to determine if an Elf executable is a NetBSD/sparc
Elf executable; a special .note section will be present in the image
(see comment on OLF below).

 > [ObECP (Obligatory Emulation Curiosity Point):  How's about a sysctl to
 > alter, dynamically, the order by which exec_elf32 determines a binary?  Er,
 > that is, which elf32 module it attempts to use _first_ befor trying th rest.

There's currently no knob to turn.  However, some way of "marking" an
image with a special .note section could easily be implemented, utilizing
existing support in the GNU binutils.  (See comment on OLF below :-).

 > 'Course, "OLF" format would be even better....]

Actually, OLF would _not_ be better.  That's pretty much the general
feeling among binutils people.  It's basically gratuitously incompatible
for relatively little (actually, given current GNU binutils technology,
none) gain.  The main problem it was "designed" to address (lack of OS
specification in the magic number) has already been solved in a compatible
way in binutils, and, in fact, NetBSD/alpha already uses this facility.
The other problem, lack of a "stripped" indicator, is sort of a
non-problem... there are other ways of determining of an Elf object is
stripped.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-6                                       Work: +1 650 604 0935
Moffett Field, CA 94035                             Pager: +1 415 428 6939