Path: utzoo!mnetor!uunet!mcvax!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.software-eng Subject: Re: Linkers Message-ID: <2788@enea.se> Date: 1 Mar 88 20:43:39 GMT References: <34359UH2@PSUVM> Reply-To: sommar@enea.UUCP(Erland Sommarskog) Followup-To: comp.software-eng Organization: ENEA DATA AB, Sweden Lines: 49 Lee Sailer (UH2@PSUVM.BITNET) writes: >How does this "smart linker" business tie into the "shared libraries" >in Unix V.3. As I understand it, (1) when I need a module, the whole >library is loaded, but (2) when another program needs a module from >the library, it shares the core image that is already in memory. > >So, for example, at any moment, there is only one copy of all the stdio >(that's standard input-output in Unix-speak) stuff in memory at any given >moment, and all programs that need it share. (This also makes the >executables smaller and saves disk space and load time.) Well, I know nothing of shared libraries or even System V.3 as such. But I guess it looks much like shareable images in VMS. If you really want to save space for your binaries under VMS, you put them in a shareable image. No matter how many of these procedure you call, none will be included. Mere references to the shared image. Slowly I am beginning to realize that this concept is not standard under Unix. Well, that explains why even the simplest of programs exceeds 100 kbytes when linked. (Pascal, f77 and Ada) Library routines, or even entire libraries, in the langauge environment are included in my private executeable. Needless to say, all such routines are provided in shareable images in VMS, unless you explcitly tell the linker not to use them. To make it even more fun, VMS permits you to install these images just like other heavily used programs like compilers, editors and usual utilities are. My exact notion of this "installation" is uncertain, but if I'm right, but I belive that it is the file header is constantly loaded into physical memory. (To INSTALL may also involve other things, such as priviliges, but that is out of the subject.) Does Unix have such a concept? As a whole: Many Unix-fans have reacted on the critics on the Unix linker with: "It does what you want, just if you use in the right way." Remember that strikes back on you, the occassion you flame another OS. Some manouvers are the way to go under Unix, but meets problems under VMS. And vice verca. Often because you don't know the best way under the another operating system. But if you look, you very often find out that you can easily do what you like, "just if you use it the right way." But sometimes you fall flat. And depending where you stumble, you pick your favourite system, which doesn't have to be Unix by necessity. It's not mine. -- Erland Sommarskog ENEA Data, Stockholm sommar@enea.UUCP "Souvent pour s'amuser les hommes d'equipages and it's like talking to a stranger" -- H&C.