Ilya Zakharevich on Sun, 6 Apr 2003 22:32:09 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Cygwin + DLL


On Sun, Apr 06, 2003 at 10:11:20PM +0200, Bill Allombert wrote:
> > > Also, install() works in gp-dyn, and the bench is about as fast as under
> > > Linux (DLL takes longer to load though).
> > 
> > Probably the opposite; just the skewed timing.  At least on OS/2, DLLs
> > are demand-loaded (a page is loaded only when needed; this includes
> > resolution of symbols); thus the load time of the DLL is included into
> > the timer output.  IIRC, on Linux the whole DLL is loaded first before
> > the timer starts.
> 
> No, it is not. Linux do demand-loading. 
> 
>   From man ld.so:
>   
>        LD_BIND_NOW
>               If  present,  causes  the dynamic linker to resolve
>               all symbols at program startup instead of when they
>               are first referenced.

This is an unrelevant (and extremely painful) mis-design of unix
dynamic loading model.  What I was discussing was demand-loading of
*pages* of the executable image (including the internal and external
fixup stage).  What you discuss is the resolution of external fixup.

On OS/2, AIX (and I think on Win32) the stage you mention (the
resolution of external fixup) is done during the link time, not the
load time.  So what you discuss is an absolutely different topic.

Hope this helps,
Ilya