Referencing through a null pointer

Lars Henrik Mathiesen thorinn at diku.dk
Thu May 5 21:33:46 AEST 1988


In article <1988Apr25.230435.3434 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
>> I imagine that PDP-11s without split I&D had *(char *)0 == 7 or 8, and
>> *(short *)0 == 0407 or 0408 (OMAGIC and NMAGIC respectively).

>Actually, no.  The a.out header was not part of the actual core image, so
>the first instruction of the program was first;

Was this always so? In that case it is a striking coincidence that OMAGIC is
the PDP-11 instruction to branch past the next 7 words -- which would be the
rest of the a.out header. I think that this suggests that the whole a.out file
was loaded in some early version of UNIX, with execution starting at 0.
  The rest of the a.out magic numbers may have been constructed by analogy in
later versions of UNIX.

>"Noalias must go.  This is           |  Henry Spencer @ U of Toronto Zoology
>non-negotiable."  --DMR              | {ihnp4,decvax,uunet!mnetor}!utzoo!henry
--
Lars Mathiesen, DIKU, U of Copenhagen, Denmark      [uunet!]mcvax!diku!thorinn
Institute of Datalogy -- we're scientists, not engineers.



More information about the Comp.lang.c mailing list