Fw: Support for builtin dlls with C++ global constructors.

Peter Hunnisett peter at transgaming.com
Fri Feb 22 11:48:51 CST 2002


Once more, this time without the vapourware.


--- Forwarded Message ---
 From: "Peter Hunnisett" <peter at transgaming.com>
 To: wine-patches at winehq.com
 Sent: Fri, 22 Feb 2002 12:47:45 -0500
 Subject: Support for builtin dlls with C++ global constructors.

Hi,
  the following provides a method of allowing builtin dlls which use C++ global
constructors which make interdll function calls to function. There should not
be any impact to spec file generation if the DelayElfInitialization option is
not provided.

  What it does is delay the libc ELF intialization of the builtin ELF dll until
the process attach happens. When the entry code for the dll is run the ELF
initialization is first completed (which results in C++ constructors being run)
and then the process attach is continued as per usual.

  One slightly strange thing that might be confusing is that all builtin dlls,
with this option specified, will have dll entry points even if one is not
specified in the .spec file. This entry point will just run the ELF
initialization and then return.

  You will need to have a linker which supports changing the ELF intialization
routine; ld, which existed in the gcc-2.95.* timeframe, does not have this
functionality as it was added sometime in '99 (if my memory serves me).
However, it's simple to patch in if you really need it.

+       * tools/winebuild/spec32.c, tools/winebuild/main.c, tools/winebuild/parser.c, tools/winebuild/build.h, tools/winebuild/README
+       Peter Hunnisett <peter at transgaming.com>
+       Add support for making builtin dlls initialized in the same order as
+       PE dlls. This is only of concern for dlls which use constructors
+       (C++).


Ciao,
Peter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: winebuild.diff
Type: application/x-unknown
Size: 12181 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20020222/718a3aae/winebuild.bin


More information about the wine-patches mailing list