CFA: pseudo-reloc v2

Charles Wilson cygwin@cwilson.fastmail.fm
Mon Oct 5 19:05:00 GMT 2009


So here's another approach. It relies on the
cygwin_terminate_process/cygwin_exit_process wrapper functions, posted
here: http://cygwin.com/ml/cygwin-patches/2009-q4/msg00028.html

Attached are two patches. The first contains modifications to the cygwin
DLL.

2009-10-04  Charles Wilson  <...>

	* ntdll.h: Add custom NTSTATUS value for pseudo-reloc
	errors STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION.
	* pinfo.cc (status_exit): Map custom pseudo-reloc
	error value STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION to 127.
	* sigproc.cc (child_info::proc_retry): Return exit code when
        STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION.

The second shows the differences between winsup/mingw/pseudo-reloc.c and
winsup/cygwin/lib/pseudo-reloc.c -- that is, it assumes you've already
copied the mingw version over.  When I post this to cygwin-patches, I'll
make a traditional diff against CVS HEAD.

This one differs from previous iterations:
 1) it uses WriteFile instead of WriteConsoleW.
 2) it gets the module name and path itself, and prints error
    messages in a form similar to that used already in
    pinfo::status_exit() for STATUS_DLL_NOT_FOUND.
 3) Nor more need for write_console code copied from cygwin proper,
    which is good because that was questionable, license-wise.

Anyway, when combined with the 'TerminateProcess' wrapper patch, this
version works in every test I've thrown at it.

--
Chuck

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02-cygwin-pseudo-reloc-support.patch
Type: application/x-patch
Size: 1767 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20091005/d460f32a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 03-pseudo-reloc-changes.patch
Type: application/x-patch
Size: 4098 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20091005/d460f32a/attachment-0001.bin>


More information about the Cygwin-developers mailing list