Mail Archives: cygwin-developers/1998/08/25/11:46:23
Currently correct user DLL initialization for cygwin32 is easy but
rather awkward using DECLARE_CYGWIN_DLL and so on (IMO of course).
May I suggest the following to take the burden off of the user?
Add the following files to libcygwin.a:
file1: Instantiate DECLARE_CYGWIN_DLL with a local "Entry" which
sets up the _hDllInstance_base and calls _DllMain AT 12.
file2: Add a _DllMain AT 12 stub which can be overridden by the user.
Add add to *link and *startfile spec to gcc:
*link:
[...] %{mdll:--dll -e __cygwin32_dll_entry AT 12}
*startfile:
%{!mdll:crt0%O%s}
The startfile entry implies -nostartfiles when making dlls. Of course,
the user can override any or all of it (either by specifying a different
entry point and/or by providing the _DllMain AT 12 callback function).
If this is reasonable, I'll work up a patch.
Regards,
Mumit
- Raw text -