delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/08/03/03:13:21

X-Spam-Check-By: sourceware.org
Message-ID: <46B2D572.8080200@gmail.com>
Date: Fri, 03 Aug 2007 09:12:50 +0200
From: =?ISO-8859-1?Q?G=FCnther_Jedenastik?= <g DOT jedenastik AT gmail DOT com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: is LD_PRELOAD available in cygwin?
References: <46B02E5F DOT 3080408 AT gmail DOT com> <46B0A563 DOT B672E63 AT dessent DOT net> <20070801183926 DOT GC6530 AT ednor DOT casa DOT cgf DOT cx>
In-Reply-To: <20070801183926.GC6530@ednor.casa.cgf.cx>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Christopher Faylor schrieb:
> On Wed, Aug 01, 2007 at 08:23:15AM -0700, Brian Dessent wrote:
>   
>> G?nther Jedenastik wrote:
>>
>>     
>>> using g++ to compile a dll which overload's the open(); glibc system call.
>>> Using preload i want to load my own dll with my open(); function. using 
>>> dlsym(); i try to load the glibc open(); function.
>>>       
>> Cygwin does not use glibc.  glibc is Linux-specifc.
>>
>>     
>>> Q1: is LD_PRELOAD available in cygwin? if yes, any hint's why it's not
>>> working? (maybe some configuration problem or so, any hint would be
>>> helpfull)
>>> Q2: are there any alternative ways to preloading causing the same result?
>>>       
>> No, LD_PRELOAD is an aspect of ELF dynamic loaders and is not available
>> on Windows.  It's not something that Cygwin can provide since it is a
>> function provided by the program loader, i.e. the operating system.
>>     
>
> Sorry, Brian, but this isn't correct.  LD_PRELOAD has been available for
> Cygwin for a while.
>
> It's not 100% like linux but it is close.  You can only override cygwin
> functions with it but that should work for open().  If this isn't working
> under cygwin, I'd suspect function decorations are not right, i.e., the
> open() function name being trapped doesn't look the same as the open in
> cygwin1.dll.
>
> ...either that or LD_PRELOAD is broken.  I haven't played with it for a
> while.
>
> cgf
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>
>
>   
well, preloading a library seems working, but the function decoration 
makes problems, but i'm sure this is my fault
it would be great if anyone has a simple example for cygwin func decorations

never the less, thx for your help

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019