This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: MSYS mode (continue)
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin-developers at cygwin dot com
- Date: Fri, 26 Jul 2013 13:36:46 -0400
- Subject: Re: MSYS mode (continue)
- References: <20130725150209 dot GA15619 at calimero dot vinschen dot de> <51F16C82 dot 7030509 at cwilson dot fastmail dot fm> <20130725205320 dot GA2725 at ednor dot casa dot cgf dot cx> <20130726081510 dot GN5086 at calimero dot vinschen dot de> <20130726151432 dot GA4495 at ednor dot casa dot cgf dot cx> <20130726161205 dot GR5086 at calimero dot vinschen dot de> <20130726163708 dot GF4495 at ednor dot casa dot cgf dot cx> <20130726164716 dot GU5086 at calimero dot vinschen dot de> <20130726170100 dot GB1626 at ednor dot casa dot cgf dot cx> <51F2ABEE dot 5010800 at dancol dot org>
- Reply-to: cygwin-developers at cygwin dot com
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.
cgf