Re: FAT binaries and Linux

Miguel de Icaza (miguel@luthien.nuclecu.unam.mx)
18 Sep 1997 13:43:43 -0500


> > The fat binary will have to be recognized by a magic that
> > actually differs from normal elf executables!
>
> Of somewhat related interest:
>
> There is a BSD (maybe OpenBSD) that uses a modified ELF to
> make it easy to recognize what architecture and OS the
> executable is for. That may be a better format.
> (it can share binfmt_elf as the loader)

Yes, OpenBSD created their own executable format called OLF. The idea
behing OLF was to have a way for the kernel to distinguish what kind
of executable you were dealing with so that the right emulation code
could be used.

The problem is that they took the quick approach: changing the ELF in
an incompatible way for just this purpose.

When they tried to push the idea to the other free operating system an
interesting discussion took place which lead to the right fix for this
problem: The binutils and gcc were modified to include a tag for the
operating system in the notes section that is compatible with the
existing ELF standard that achieves the same goal without making an
incompatible change. I do not know if they are still using their OLF
code despite the right fix being available to developers for at least
six months now.

Even then, both approaches (OLF and the notes section addition) are
there just to distinguish which operating system the executable is
meant to run on: ie, distinguishing between Linux/ELF and NetBSD/ELF
binaries for example. It does not address the fat binaries issue at
all.

I personally, do not believe that ELF could be extended in a
compatible way to include support for fat binaries.

cheers,
Miguel.