delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/02/17/14:14:33

From: cgf AT bbc DOT com (Christopher Faylor)
Subject: Re: Optimizing memset/memcpy/strcpy/etc.
17 Feb 1998 14:14:33 -0800 :
Message-ID: <EoJn0D.6H9.cygnus.cygwin32.developers@bbc.com>
References: <01BD3B8F DOT A9DF2EA0 AT gater DOT krystalbank DOT msk DOT ru>
Reply-To: cygwin32-developers AT cygnus DOT com
To: cygwin32-developers AT cygnus DOT com

In article <01BD3B8F DOT A9DF2EA0 AT gater DOT krystalbank DOT msk DOT ru>,
Sergey Okhapkin  <cygwin32-developers AT cygnus DOT com> wrote:
>Ian Lance Taylor wrote:
>> Some of the posts on the gnu-win32 list have implied that Windows
>> always relocates DLLs if they have relocation information.  I would
>> hope that that is not true--if the DLL is loaded at the image address,
>> it should not be relocated.  Does anybody know exactly what Windows
>> does?  Perhaps there is something incorrect about the DLLs which
>
>It seems to me not true. Windows (at least NT) relocates a dll only if 
>address space is in use by any other dll/stack/program code/alloced memory. 
>But dll reallocation is not only slowness of process startup, another one 
>is linking of application/dll imports/exports - it's really slow process - 
>for every import loader performs a binary search of corresponding dll's 
>export by name.

Has anyone experimented with the editbin that comes with MSDEV?  It seems
to indicate that it will speed up the load time of a DLL:

    EDITBIN /BIND

    This option sets the addresses of the entry points in the import address
    table for an executable file or DLL.  Use this option to reduce load
    time of a program.  /BIND[:PATH=path]

    Specify the program' executable file and DLLs in the files argument on
    the EDITBIN command line.  The optional path argument to /BIND specifies
    the location of the DLLs used by the specified files.  Separate multiple
    directories with a semicolon (;).  If path is not specified, EDITBIN
    searches the directories specified in the PATH environment variable.  If
    path is specified, EDITBIN ignores the PATH variable.  By default, the
    program loader sets the addresses of entry points when it loads a
    program.  The amount of time this process takes varies, depending on the
    number of DLLs and the number of entry points referenced in the program.
    If a program has been modified with /BIND, and if the base addresses for
    the executable file and its DLLs do not conflict with DLLs that are
    already loaded, the operating system does not need to set these
    addresses.  In a situation where the files are incorrectly based, the
    operating system relocates the program's DLLs and recalculates the
    entry-point addresses, which adds to the program's load time.
-- 
http://www.bbc.com/	cgf AT bbc DOT com			"Strange how unreal
VMS=>UNIX Solutions	Boston Business Computing	 the real can be."

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019