Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!spool.mu.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!dkuug!iesd!iesd.auc.dk!fischer From: fischer@iesd.auc.dk (Lars P. Fischer) Newsgroups: comp.sys.acorn Subject: Re: C versus ARM take 2 Message-ID: Date: 26 Feb 91 19:00:53 GMT References: <807@utrcu1.UUCP> <1786@svin02.info.win.tue.nl> Sender: news@iesd.auc.dk Organization: Mathematics and Computer Science, University of Aalborg Lines: 35 In-reply-to: rcpieter@wsinfo11.info.win.tue.nl's message of 23 Feb 91 13:01:00 GMT >>>>> On 23 Feb 91 13:01:00, rcpieter@wsinfo11.info.win.tue.nl (Tiggr) said: Tiggr> Including a library because you use printf causes the grief. The Tiggr> printf function is part of and uses stdio, and stdio simply is a lot of Tiggr> code. Even a `smart' linker (I never knew the Acorn one wasn't) could Tiggr> not solve this problem. There's a simple solution to this kind of problem -- dynamic linking. The linker only resolves the library references with actually copying the code. When the program is started, the actual binding is done and the code is copied into memory, provided it's not already there. This way, only one copy of stdio, say, exists on disk at a time, and at maximum one copy exists in memory. Saves disk space and memory. Of course, dynamic linking requires operating system support. Real operating systems, like SunOS, SysVr4 and Mach have it. Heck, even OS/2 have it. Tiggr> But then again, of a non trivial program, most code will be Tiggr> object code, not library code. Not so. A real application might use a library of data structures (strings, trees, hash tables, ..), a user interface construction library, a database library, a 3D graphics library, a knowledge base library, and more. This kind of thing is *not* unusual, especially if the program is written in an OOPL. On a typical Unix workstation, dynamic linking will easily save you 100 Mbytes of disk space and 4-8 Mbytes of RAM. /Lars -- Lars Fischer, fischer@iesd.auc.dk | Beauty is a French phonetic corruption CS Dept., Univ. of Aalborg, DENMARK. | - FZ