1 Dec 2000 13:59
Re: Dynamic loading. Again.
John Max Skaller <skaller <at> ozemail.com.au>
2000-12-01 12:59:06 GMT
2000-12-01 12:59:06 GMT
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!(Continue reading)
RSS Feed