English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Dynamic loading. Again.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-12-03 (22:12)
From: John Max Skaller <skaller@o...>
Subject: Re: Dynamic loading. Again.
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