a.out magic numbers (was Referencing through a null pointer)

Henry Spencer henry at utzoo.uucp
Fri May 27 03:18:14 AEST 1988


> The magic number was used  in  the  V6  and  V7  bootstraps...
> ...no unix program had the 407 in its address space...
> I can't recall when Ken or Dennis said it stopped  being
> used in executables.

I got private mail from DMR during the earlier discussion of this.  He said,
as I recall, that the 407 was in the address space in the very beginning of
Unix on the 11.  However, it vanished quite early, possibly at the time of
the assembler-to-C rewrite.  (He wasn't sure of the exact timing either.)
It did linger for quite a while in bootstraps.

> The bootstrap  looked it its first word and if it was 407 then copied
> itself over  the  a.out  header...

Not quite correct for V7, although it may have been for V6.  The V7 boots
check whether they are in low core, and copy themselves to high core if so.
They do inspect the first word for a 407 first, but only to determine where
the copying should start from (they skip the header if it's there).
-- 
"For perfect safety... sit on a fence|  Henry Spencer @ U of Toronto Zoology
and watch the birds." --Wilbur Wright| {ihnp4,decvax,uunet!mnetor}!utzoo!henry



More information about the Comp.lang.c mailing list