[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "a.out"



[I'm pulling two replies into one message here, so excuse me if this
 starts to become incomprehensible.]

Bill Hogan <bhogan@rahul.net> wrote:
> 
>    This morning I read something that made me realize I have
> been using the term "a.out" where I should have been using
> the term "COFF".

Not quite.  If you are talking about Linux executables, then a.out
is the right term.

>    According to "The Magic Garden Explained" [GoodHeart and
> Cox, Prentice-Hall, 1994] the terms "Extensible Library
> Format" (ELF) and "Common Object Format" ("COFF") are
> different ways of _organizing_ the information in a.out
> files.

This is true.  However, so is a.out :-)  The confusing part here,
I think, is the dual usage of the term "a.out" (see below).

[Snipped details of COFF -> ELF progression - See below]

>    I still have the impression that "executable binary" is
> an acceptable substitute for "a.out" when the context is
> clear.

More-or-less.  "Executable" means a file that you can execute on
your machine, whichever binary format it uses.  "a.out" can mean
the same, or it can mean "a file in the a.out binary format".


Karl M. Hegbloom" <karlheg@bittersweet.or.us> wrote:

[Section on cc generating a file called "a.out" snipped]

>  There must be a historical reason for the name a.out.  I wonder what
> it is?  Who can we ask?

I'll give it a try.  Way back in the mists of antiquity (1975) there
was V7 Unix (and before that V1 through V6 of course).  The format of
a file that the system could execute was called "a.out".  So it made
sense to call the default linker output file "a.out", since it was
an a.out file!

Now a.out had a number of deficiencies, notably that the original
format only allowed seven significant characters in symbol names.
So in the 80's, both AT&T and Berkeley decided to fix it.  The BSD
solution was to slightly rework the existing "a.out" format, to fix
the problems that people had noticed.  Some early System V machines
also used this kind of technique, but with (I believe) System V
release 2 (SVr2) AT&T decided to "solve" the problems by converting
to a new binary format: COFF (Common Object File Format).

So along the Unix world went, with the two main variants (System V
and 4.xBSD) using different object file formats.  Since Unices don't
tend to be binary-compatible anyway (it wasn't until the early 90s
that PCs really got good enough to run Unix), this wasn't too much of
a problem.

So, in the 90s, along came ELF, which is superior to both a.out and
COFF, and is a vendor-independent standard to boot.  So AT&T and Sun
moved to ELF format (with COFF and a.out support) when they put SVr4
together.  I have no idea whether BSD systems are moving to ELF.

So all the other Unices have gone through the same process of moving
from one binary format to another that Linux is now.  The difference
is that the other systems have been proprietary, and have made the
change in a single release.  Shared libraries don't help either; I'd
say that most of the problems the a.out/ELF move are causing are down
to shared libraries.  Wouldn't want to do without them though.

Hope this all helps (and was of interest)...
--
M a l c . . .             |  "We've checked, and it's definitely not a bug.
(malc@thing.demon.co.uk)  |  It's fixed in the new release."  -- Help line.


Reply to: