From: khan AT xraylith DOT wisc DOT edu (Mumit Khan) Subject: DLL initialization suggestion 25 Aug 1998 11:46:23 -0700 Message-ID: <9808251837.AA18913.cygnus.cygwin32.developers@modi.xraylith.wisc.edu> To: cygwin32-developers AT cygnus DOT com 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