libraries

Brandon S. Allbery allbery at ncoast.UUCP
Sun Jan 15 05:50:08 AEST 1989


As quoted from <7 at minya.UUCP> by jc at minya.UUCP (John Chambers):
+---------------
| As for the cost of all the extra directory searching:  Do you think 
| that archives don't contain a directory, or that searching through 
| them is free?  Why should one expect that the linker's search through 
| an (unsorted) archive directory will be any faster than the kernel's?
+---------------

Good point.  In fact, "ar" archives (on systems lacking ranlib or the System
V archive TOC) *don't* have indexes; which, in the worst case, leads to ld
reading the entire archive to discover that what it's looking for isn't
there.  (This can happen if I include an unnecessary archive reference, e.g.
"-ltermcap" when I'm not using termcap.  This is optimal?

In fact, "namei" is *less* expensive than searching through a library index
in user code, unless namei() can't be swapped out (I don't see why, the
state is tucked away inside a process's ublock, not global).

[BTW, I notice that my friend of the "an archive and a file are completely
different, you can't exchange one for the other" pursuasion is being
silent.  Have I actually managed, for the first time in 6 months, to say
something in this group that contained some intelligence?  Given my past
record of flubs, I find that difficult to believe.  ;-) :-( ]

++Brandon
-- 
Brandon S. Allbery, moderator of comp.sources.misc    allbery at ncoast.org (soon)
uunet!hal.cwru.edu!ncoast!allbery		    ncoast!allbery at hal.cwru.edu
      Send comp.sources.misc submissions to comp-sources-misc@<backbone>
NCoast Public Access UN*X - (216) 781-6201, 300/1200/2400 baud, login: makeuser



More information about the Comp.unix.wizards mailing list