MSYS mode (continue)

Christopher Faylor
Fri Jul 26 17:36:00 GMT 2013

On Fri, Jul 26, 2013 at 10:03:42AM -0700, Daniel Colascione wrote:
>On 7/26/2013 10:01 AM, Christopher Faylor wrote:
>>Daniel Colascione's point is a stumbling block though since the
>>LD_PRELOAD method doesn't currently allow hooking anything other than
>>the main executable.  That means that, say, ncurses wouldn't know about
>>an MSYS-hooked uname.  It is possible to work around that but it would
>>require the addition of new code to the LD_PRELOAD mechanism, requiring
>>that we keep a table of hooked functions.
>You don't need to maintain your own table.  When you hook, you just
>have to munge all the import tables of all currently-loaded modules,
>then munge the export table of the module you want to hook.  Munging
>the export table will take care of any modules that load in the future.

I think it would be faster to keep a list of functions since, otherwise,
on fork, it seems like you'd have to walk the whole Cygwin export list,
looking for functions to re-target.


More information about the Cygwin-developers mailing list