On 2/25/23, Brian Walden <tuhs(a)cuzuco.com> wrote:
It was originaly 205. See A.OUT(V) (the first page)
at
https://www.bell-labs.com/usr/dmr/www/man51.pdf it was documented as to
why.
The header always contains 6 words:
1 "br .+14" instruction (205(8))
2 The size of the program text
3 The size of the symbol table
4 The size of the relocation bits area
5 The size of a data area
6 A zero word (unused at present)
I always found this so elegant in it's simplicity. Just load and start
execution at the start (simplifies exec(2) in the kernel) I always wondered
if this has done anywhere else before, or invenetd first in unix.
IBM's Basic Program Support (BPS) for System/360 was a set of
stand-alone utilities for developing and running stand-alone programs.
BPS/360 wasn't really an operating system because there wasn't any
resident kernel. You just IPLed (Initial Program Load; IBM-speak for
"boot") your application directly. So the executable format for BPS
had a bootstrap loader as the "program header". Not quite the same
thing as a.out's 205(8) magic number, but similar in concept.
I don't know of any other OS ABI that uses this trick to transfer
control to application programs.
Microsoft uses something similar in PECOFF. A PECOFF executable for
x86 or X86-64 starts with a bit of code in MS-DOS MZ executable format
that prints the message "This program cannot be run in DOS mode".
-Paul W.