From: CSBVAX::MRGATE!RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP 16-SEP-1988 13:48 To: ARISIA::EVERHART Subj: Re: Re: Weird C linker problem [VAX C RTL in a shareable image library] Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Fri, 16 SEP 88 07:36:49 PDT Received: from Venus.YCC.Yale.Edu by KL.SRI.COM with TCP; Fri, 16 Sep 88 07:12:07 PDT Date: Fri, 16 Sep 88 10:04 EST From: "Jerry Leichter (LEICHTER-JERRY@CS.YALE.EDU)" Subject: Re: Re: Weird C linker problem [VAX C RTL in a shareable image library] To: ABK07@DK0RRZK0.BITNET, INFO-VAX@KL.SRI.COM X-VMS-To: IN%"ABK07@DK0RRZK0.BITNET",INFOVAX As far as I know, the LNK$LIBRARY mechanism also works with shareable image symbol table libraries, so create your own shareable library with $ LIBRARY/CREATE/SHARE CRTL SYS$SHARE:VAXCRTL and def. $ DEFINE LNK$LIBRARY your_directory:CRTL.OLB This should do the same as linking your C program via an options file to the shared RTL. It is true that the LNK$LIBRARY mechanism works with shareable image librar- ies. Unfortunately, shareable image libraries don't work quite correctly! There are some very old, very deep-seated bugs in the Linker that will cause what you are proposing to fail. (I forget the details - under certain circum- stances when linking against a shareable image library, the Linker allocates the same PSECT more than once. The result is all sorts of confusion, such as multiple copies of the file structures defining stdin.) The bugs require a very particular set of circumstances which are only likely to come up with VAX C (because of the particular way it uses PSECT's). They also seem to be very difficult to fix - read "major redesign"? They've sur- vived through complaints (and, one would assume, SPR's) against 2 and perhaps 3 major versions of VMS. -- Jerry