\"ld\" and \".a\" files

Rob Warnock rpw3 at redwood.UUCP
Sat Jan 19 15:05:21 AEST 1985


+---------------
| > ...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



More information about the Comp.unix.wizards mailing list