Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!decvax!ittatc!dcdwest!sdcsvax!ucbvax!info-vax From: garry@TCGOULD.TN.CORNELL.EDU (Garry Wiegand) Newsgroups: mod.computers.vax Subject: Re: Dereferencing NULL pointers Message-ID: <8602042007.AA02717@tcgould.tn.cornell.edu> Date: Tue, 4-Feb-86 15:07:14 EST Article-I.D.: tcgould.8602042007.AA02717 Posted: Tue Feb 4 15:07:14 1986 Date-Received: Sat, 8-Feb-86 05:43:55 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 26 Approved: info-vax@sri-kl.arpa In a recent article RIZZI@USC-ISIB.ARPA wrote: > I am porting a UNIX application written in C to VAX/VMS. >Aside from file name translation, the biggest problem I have >is in dealing with code that blithely dereferences NULL pointers, >... To get legal memory at virtual address zero (one solution to your problem), the trivial solution is add a 'Based image' linker option: $ link foo, baz, sys$input/options BASE = 0 This has the unfortunate side effect of nailing down everything in the image -- any shareable images you reference will not be allowed to change size. The fancier solution is: $ link foo, baz, sys$input/options CLUSTER = CODE_CLUSTER, 0 COLLECT = CODE_CLUSTER, $CODE Which has the net effect of moving the $CODE program section down to virtual address zero. I know these tricks because I unfortunately ported Nroff once upon a time. garry wiegand