On 12/28/18, Noel Chiappa <jnc(a)mercury.lcs.mit.edu> wrote:
If so, the thing is that the V6 linker won't pull in an object module from
a
library unless a global in it satisfies an already existing (i.e. in the
linking process) undefined global. (I don't know if this is true of later
linkers; never used 'em.)
I think this has been pretty much universal behavior for all linkers
on all OSes since the 1960s. It continues to be true today.
Sometimes one runs into a situation where a module loaded from lib1.a
has an undefined symbol that causes a module from lib2.a to be loaded,
and that module in turn has an undefined symbol that is defined in
lib1.a. In that case, you have to cause the linker to scan lib1.a
twice:
ld main.o lib1.a lib2.a lib1.a
-Paul W.