Path: utzoo!attcan!uunet!lll-winken!ames!xanth!nic.MR.NET!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon S. Allbery) Newsgroups: comp.unix.wizards Subject: Re: libraries Message-ID: <13333@ncoast.UUCP> Date: 14 Jan 89 19:50:08 GMT References: <15080@mimsy.UUCP> <1278@nusdhub.UUCP> <15126@mimsy.UUCP> <445@thirdi.UUCP> <7@minya.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon S. Allbery) Followup-To: comp.unix.wizards Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 30 As quoted from <7@minya.UUCP> by jc@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@ncoast.org (soon) uunet!hal.cwru.edu!ncoast!allbery ncoast!allbery@hal.cwru.edu Send comp.sources.misc submissions to comp-sources-misc@ NCoast Public Access UN*X - (216) 781-6201, 300/1200/2400 baud, login: makeuser