Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site redwood.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!zehntel!hplabs!hpda!fortune!rhino!redwood!rpw3 From: rpw3@redwood.UUCP (Rob Warnock) Newsgroups: net.unix-wizards Subject: Re: \"ld\" and \".a\" files Message-ID: <133@redwood.UUCP> Date: Sat, 19-Jan-85 00:05:21 EST Article-I.D.: redwood.133 Posted: Sat Jan 19 00:05:21 1985 Date-Received: Thu, 24-Jan-85 07:08:44 EST References: <7335@brl-tgr.ARPA> <364@rlgvax.UUCP> Organization: [Consultant], Foster City, CA Lines: 33 +--------------- | > ...The conclusion I reached is that "ld" in fact loads not the | > routine but the FILE containing the definition of the global symbol. | Most OSes that I know of work that way - object libraries are archives of | object modules (an object module being an object file built from one | source file) and if a given object module resolves an undefined symbol | the whole module, not just the part of the module that resolves the symbol, | is included. UNIX is no exception. Perhaps TENEX/TOPS-20 is... | Guy Harris | {seismo,ihnp4,allegra}!rlgvax!guy +--------------- No, at least TOPS-10 works the same way, and I believe so does TOPS-20. The whole module gets loaded (but not necessarily the whole file). Here is one bit of trivia for you though: Some systems allow more than one "module" per source file. The PDP-10 assembler (MACRO-10) has a pseudo-op called "PRGEND" which can end the module and allow another module to begin in the same source file (with another "TITLE" pseudo-op). It was added to the assembler primarily to assist in compiling the standard system libraries (FORTRAN, COBOL, etc.) to avoid the overhead of running the assembler from scratch to compile each of hundreds of little routines! (Another advantage is that if any macro libraries were loaded ("UNIVERSALS"), they need be loaded only once per assembler run.) But each of them is a separate module, and may (and often does) contain multiple routines or entry points. The output from such a compile is a "library" (UNIX "archive"). Rob Warnock Systems Architecture Consultant UUCP: {ihnp4,ucbvax!dual}!fortune!redwood!rpw3 DDD: (415)572-2607 USPS: 510 Trinidad Lane, Foster City, CA 94404