Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uakari.primate.wisc.edu!sdd.hp.com!spool.mu.edu!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.unix.internals Subject: Re: Shared Lib Question (ISC) Message-ID: <1991May16.081003.17169@Think.COM> Date: 16 May 91 08:10:03 GMT References: <1991May15.043318.7046@mp.cs.niu.edu> <194@titccy.cc.titech.ac.jp> Sender: news@Think.COM Reply-To: barmar@think.com Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 22 In article rang@cs.wisc.edu (Anton Rang) writes: > I'm not familiar enough with OSes running on segmented architectures >to be sure if there are any that use this approach, but I seem to >recall that MULTICS did, and that the cost to call a shared library >routine was higher on the *first* call from a particular point but >that the code was then patched to jump directly to the routine. >(Which presumably defeated code sharing? I'll shut up now because I'm >not really sure and can't find my MULTICS papers.) No, Multics (capital M, small rest) doesn't patch the text segment -- it is almost always sharable. Multics uses indirection through the static data segment for dynamic linking. It's the entry in this segment that is patched the first time the routine is called, so future calls to the routine are non-trapping indirect calls. The first call is more expensive simply because that is when the routine is linked. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar