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:19:13 +0100

mru@kth.se (Måns Rullgård) writes:

> 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.

Note, not all dynamic linkers support this.

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


Relevant Pages

  • Re: Do fork copies the "Code" Memory space?
    ... Andrei Voropaev writes: ... since I don't know for sure about DLL. ... > in the same physical memory. ... relocation table listing all instructions using absolute addresses ...
    (comp.unix.programmer)
  • 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: 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: 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)

Quantcast