[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dlopening the C runtime library
From: |
Ralf Wildenhues |
Subject: |
Re: dlopening the C runtime library |
Date: |
Sun, 6 Dec 2009 14:58:41 +0100 |
User-agent: |
Mutt/1.5.20 (2009-10-28) |
* Sam Varshavchik wrote on Sun, Dec 06, 2009 at 02:52:52PM CET:
>
> My use case is intercepting a main application's calls to library
> functions. I set LD_PRELOAD to preload my own shared library which
> provides replacement symbols for socket(), connect(), etc…
What level of portability do you need? GNU/Linux only? ELF?
> My wrapper needs to find the real socket() and connect(). I haven't
> checked this yet, but I suspect that since my shared library was
> loaded ahead of libc, after lt_dlopen(NULL), using lt_dlsym() will
> simply return a pointer to my own symbols, rather than libc's.
Yes, that sounds like it, although I must admit that I haven't fully
understood the above description. Uses of -Bsymbolic may give you
trouble.
Cheers,
Ralf