[PATCH] Fix dlopen vs cxx malloc bug.

Dave Korn dave.korn.cygwin@googlemail.com
Wed Aug 12 21:19:00 GMT 2009


    Hey gang,

  Here's the patch for the dlopen problem.  I've added perhaps more commenting
than is strictly necessary but this is hairy stuff and we want it to be
comprehensible in the future.  (I've also spent some time writing how-*
documentation and that'll follow shortly.)

winsup/cygwin/ChangeLog:

	* cxx.cc (default_cygwin_cxx_malloc): Enhance commenting.
	* dll_init.cc (dll_dllcrt0_1): Likewise.
	* dlfcn.cc (dlopen): Prevent dlopen()'d DLL from installing any
	cxx malloc overrides.
	* include/cygwin/cygwin_dll.h (__dynamically_loaded): New variable.
	* lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Check it and only
	install cxx malloc overrides when statically loaded.  Extend comments.

  Tested against a big chunk of the g++ testsuite, and specifically the
malloc-related tests that verify function replacement, and against old testcases
and the dlopen testcase.  Ok?

    cheers,
      DaveK


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cxx-overrides-dlopen-fix.diff
Type: text/x-c
Size: 7512 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20090812/673cf02b/attachment.bin>


More information about the Cygwin-patches mailing list