From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA16597 for caml-red; Sun, 3 Dec 2000 23:12:59 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA18116 for ; Fri, 1 Dec 2000 14:00:45 +0100 (MET) Received: from localhost.localdomain (ppp163.dyn146.pacific.net.au [210.23.146.163]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id eB1D0Zn22860; Fri, 1 Dec 2000 14:00:36 +0100 (MET) Received: from ozemail.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id XAA12222; Fri, 1 Dec 2000 23:59:06 +1100 Message-ID: <3A27A099.4EF5F3BD@ozemail.com.au> Date: Fri, 01 Dec 2000 23:59:06 +1100 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: fabrice.le_fessant@inria.fr CC: Vitaly Lugovsky , caml-list@inria.fr Subject: Re: Dynamic loading. Again. References: <14885.12770.825697.215308@cremant.inria.fr> <3A25FB93.AD27098B@ozemail.com.au> <14886.31615.260102.716998@cremant.inria.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr Fabrice Le Fessant wrote: > Well, you are right. You don't need to generate position independent > code, but it is better if you want the code to be shared between > processes. Otherwise, each process has its own code, and a shared > library is not that shared ... Nope. The code can be shared anyhow: it is relocated by patching at load time and everyone uses the same load address. Only one copy of the code, used by all clients. The per process data lives at the same address for every process, but the underlying memory is swapped for every task switch (at least, on the 486 this is done). So exactly the same logical memory addresses can be used by multiple processes without interference. No application level register or use of relative addressing is required. I don't know about Linux, but NT copies the per process data lazily (that is, each processes copy of the data space is mapped on to a read only memory page at the same address, and the page is copied on write to new physical memory, which is located, for THAT process only, at the same address). Summary: all application level NT and Linux-486 code is relocatable, no application level register is required, absolute address modes can be used freely. The big problem is, in fact, sharing memory between processes! -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 checkout Vyper http://Vyper.sourceforge.net download Interscript http://Interscript.sourceforge.net