[TUHS] Deleted lib1 and lib2 in v6, recoverable?

Paul Winalski paul.winalski at gmail.com
Mon Dec 31 04:34:00 AEST 2018


On 12/28/18, Noel Chiappa <jnc at 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.


More information about the TUHS mailing list