C++ Winelib problems

Peter Hunnisett peter at transgaming.com
Fri Jan 25 04:15:47 CST 2002


On 22 Jan 2002 15:23:34 -0800, Alexandre Julliard said:

> "Peter Hunnisett" <peter at transgaming.com> writes:
>  
>  >     I've attached a patch which removes the recursive dep search from
>  > MODULE_DllProcessAttach and moves MODULE_DllProcessAttach from LoadLibraryExA
>  > into MODULE_LoadLibraryExA. Does this seem like a reasonable approach to take?
>  > Any problems with the patch?
>  
>  I think the current order is correct, and it needs to be done this way
>  because of circular dependencies. The problem is that you need to
>  delay calling constructors until the DLL entry point is called. This
>  probably requires some compiler/linker magic.

Ok. This is about the best voodo I can chant up at this point in time. I'm not
terribly fond of it but I didn't have a chicken, or chicken substitute, around
to sacrifice for extra coding power.  It's not tested with unicode stuff and on
any platforms other than x86, but it appears to have the semblance of a
solution.

The basic concept is that you must link the 32 bit spec file last among the
spec files, but before any object files. We short circuit the normal way to
build the ELF init section by starting a new function
__wine_dllname_deferred_init which should end up containing any special init
section code from the object files and the standard ELF initialization stuff.
We then bind in an entry point for the builtin dll which invokes the deferred
initialization code and then run the actual initialization entry point if there
is one.

It requires a little bit of grease since ntdll can't be called until the ctor
stuff is invoked so it gets special permission to be built the old way but of
course, wine wants to call it early on in life. Other than that, basically
everything is limited to making winebuild produce even more stuff.

How does this seem? On the right track? Suggestions for improvement? Am I
missing anything with the assembler?


>  
>  -- 
>  Alexandre Julliard
>  julliard at winehq.com

Ciao,
Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lump_ctor_and_entry_point.diff
Type: application/x-unknown
Size: 6963 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20020125/7a191b34/lump_ctor_and_entry_point.bin


More information about the wine-devel mailing list