Question about linking files

Devin_E_Ben-Hur at cup.portal.com Devin_E_Ben-Hur at cup.portal.com
Wed Mar 29 09:13:42 AEST 1989


> I think that this discussion of external linkages has missed the point of
> the original poster, although I could be missing the point too.
> 
> If I read the original correctly, he is saying that given:
> 
>    MY.LIB  <==  A.OBJ  entry points A1  A2  A3  externals C1
>                 B.OBJ  entry points B1  B2  B3  
>                 C.OBJ  entry points C1  C2  C3
> 
Nope, the original poster made no mention of libraries.  He wished the linker
to treat: LINK A+B+C,P.EXE;  as if all the functions in A,B,&C were
independantly compiled then made into a library and linked only if referenced.

> and given
> 
>    main () { a1();  a3(); }
> 
> then the Turbo C linker will include ALL 3 modules in the resulting
> executable, whereas it is plain that B.OBJ is not required.  If this
> is, in fact, the case, then the Turbo C linker is _broken_.  The Microsoft
> Linker will include only A.OBJ and C.OBJ in the executable.
> 
The turbo linker will perform just link the uSoft linker for this.  Even if
it did include B.OBJ, it would not be _broken_  merely an inferior
implementation.  A broken linker produces an incorect program, including
b.obj does not make the output incorrect, merely larger than neccessary.

> Now, if A, B, and C are all modules on a single OBJ, and that OBJ is fed
> to the linker, then one would expect all three to appear on the executable.
> I don't think that was the question, however.
> 
> Tim_CDC_Roberts at cup.portal.com                | Control Data...
> ...!sun!portal!cup.portal.com!tim_cdc_roberts |   ...or it will control you.

Devin_Ben-Hur at Cup.Portal.Com
...ucbvax!sun!portal!cup.portal.com!devin_ben-hur



More information about the Comp.lang.c mailing list