From: Danny Smith <dannysmith@cl...> - 2008-04-30 00:53:27
> 2) Is there a simple one-or-two-line summary of why you have
> to remove the
> chkstk and ctors objects before building the dll and put them
> back afterward
> as the only "genuine" objects in what is otherwise a library
> full of import
__chkstk is not a normal function. It has unusual calling convention.
__CTOR_LIST__ and __DTOR_LIST__ must exist in every executable (.exe and .dll's)
and not share a single copy from a libgcc.dll. At least in mingw world.
From: Danny Smith <dannysmith@cl...> - 2008-04-30 01:18:34
> -----Original Message-----
> __chkstk is not a normal function. It has unusual calling
Maybe that isn't as important as I once thought. I didn't like the idea of users trying to
using it like MSVCRTS's _alloca (which is equiv. to GCC's __builtin_alloca()).
To export from dll as a function (not DATA), you need to tell assembler
and linker that it is a function
--- cygwin.asm (revision 134695)
+++ cygwin.asm (working copy)
@@ -41,7 +41,10 @@
by the OS virtual memory manger are allocated in correct sequence. */
+ .def ___chkstk; .scl 2; .type 32; .endef
+ .def __alloca; .scl 2; .type 32; .endef