From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17541 invoked by alias); 26 Jul 2013 17:36:55 -0000 Mailing-List: contact cygwin-developers-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com Received: (qmail 17519 invoked by uid 89); 26 Jul 2013 17:36:55 -0000 X-Spam-SWARE-Status: No, score=1.7 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO mho-02-ewr.mailhop.org) (204.13.248.72) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 26 Jul 2013 17:36:54 +0000 Received: from pool-173-48-46-190.bstnma.fios.verizon.net ([173.48.46.190] helo=cgf.cx) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1V2lwd-0008qb-0e for cygwin-developers@cygwin.com; Fri, 26 Jul 2013 17:36:47 +0000 Received: from localhost (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 40CF960066 for ; Fri, 26 Jul 2013 13:36:46 -0400 (EDT) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/V1HSsE45I5heqm+9Ix3Ne Date: Fri, 26 Jul 2013 17:36:00 -0000 From: Christopher Faylor To: cygwin-developers@cygwin.com Subject: Re: MSYS mode (continue) Message-ID: <20130726173646.GD1626@ednor.casa.cgf.cx> Reply-To: cygwin-developers@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com References: <20130725150209.GA15619@calimero.vinschen.de> <51F16C82.7030509@cwilson.fastmail.fm> <20130725205320.GA2725@ednor.casa.cgf.cx> <20130726081510.GN5086@calimero.vinschen.de> <20130726151432.GA4495@ednor.casa.cgf.cx> <20130726161205.GR5086@calimero.vinschen.de> <20130726163708.GF4495@ednor.casa.cgf.cx> <20130726164716.GU5086@calimero.vinschen.de> <20130726170100.GB1626@ednor.casa.cgf.cx> <51F2ABEE.5010800@dancol.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51F2ABEE.5010800@dancol.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2013-07/txt/msg00048.txt.bz2 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