Changes between Version 2 and Version 3 of DynamicByDefault/Windows


Ignore:
Timestamp:
Nov 27, 2012 2:00:26 PM (17 months ago)
Author:
igloo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DynamicByDefault/Windows

    v2 v3  
    2222 
    2323Windows doesn't support that, but there is code to do so [http://www.joachim-bauch.de/tutorials/loading-a-dll-from-memory/ here]. Downsides are that it is MPLed (to check: is that a problem?), it involves replicating some of the system linker (but not as bad as the current GHCi linker). It is also untested, so we are not 100% sure that it will work. 
     24 
     25== Delay loading == 
     26 
     27Another possibility is delay loading. This only links a DLL when a function from it is actually called, which means that the main function is called before the DLLs are loaded. The main function therefore has an opportunity to call `AddDllDirectory` first. 
     28 
     29However, we have problems when we try to do things like (I think) getting the info table of a function that hasn't been called yet. If it hasn't been called then its address hasn't been updated, so we get garbage. There is a function, `__HrLoadAllImportsForDll`, which is supposed to update all addresses, but [http://sourceforge.net/mailarchive/forum.php?thread_name=20121123141320.GA10578%40matrix.chaos.earth.li&forum_name=mingw-w64-public it seems not to work]. Fixing that would therefore be necessary, but I am unsure whether it would be sufficient.