Re: Do 'fork' copies the "Code" Memory space?

From: Måns Rullgård (mru_at_kth.se)
Date: 01/26/04


Date: Mon, 26 Jan 2004 11:13:55 +0100

Andrei Voropaev <avorop@mail.ru> writes:

> Not really. There's no need to have 2 copies of DLL. I better say .so
> library, since I don't know for sure about DLL. The code would be stored
> in the same physical memory. But different processes may access that
> code at different virtual addresses.

This works only if the shared library uses position independent code.
If it doesn't, all memory references in the code will have to be
adjusted to point to the correct places. The library will have a
relocation table listing all instructions using absolute addresses
that need to be checked.

-- 
Måns Rullgård
mru@kth.se


Relevant Pages

  • Re: CE DLL alignment.
    ... It occupies ONLY the actual size of the DLL in physical memory, ... allocates space in virtual memory for each DLL starting on a 64K boundary. ... You really should not try to rely on the exact behaviour of this particular ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Delphi to take advantage of multiple threads within the compiler>
    ... address into any given function pointer - ergo if different processes need to map the dll to different addresses, they by definition cannot share the same physical memory image. ... Our applications now load noticeably faster, ...
    (borland.public.delphi.non-technical)
  • Re: BadImageFormatException on framework 64 bit
    ... Rudy wrote: ... If the application is developed yourself, you can set it in the development tools to mark it always running in 32 bit mode. ... Hence, overall the system still can take some advantage, e.g. the system can use more physical memory. ... the best solution is to convert the 32 bit DLL to 64 bit DLL. ...
    (microsoft.public.dotnet.framework)
  • Re: Do fork copies the "Code" Memory space?
    ... since I don't know for sure about DLL. ... >> in the same physical memory. ... > relocation table listing all instructions using absolute addresses ... Måns Rullgård ...
    (comp.unix.programmer)
  • Re: mmap and physical memory
    ... On 2004-09-07, Andrei Voropaev wrote: ... >> libraries are not swapped to a swap area, ... >> doesn't start killing things when the system is out of physical memory. ... >> of virtual addresses.(the kernel usually has a virtual address ...
    (comp.os.linux.development.apps)

Quantcast