[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to hook into shared libraries (by chaining)
From: |
Christian Parpart |
Subject: |
Re: how to hook into shared libraries (by chaining) |
Date: |
Thu, 15 Feb 2007 14:49:48 +0100 |
User-agent: |
KMail/1.9.6 |
On Tuesday 13 February 2007 13:33:58 Ralf Wildenhues wrote:
> * Christian Parpart wrote on Tue, Feb 13, 2007 at 11:59:35AM CET:
> > I want to override some functions located in libGL.so and libX11.so, in
> > order to capture movies from (any) OpenGL application.
> >
> > There are now several ways to achieve this, but none of them seems to be
> > userfriendly *and* ideal (system/platform independant).
>
> The question is how portable you want to be. Only Gentoo? Only
> GNU/Linux? Only ELF systems? Only GNU binutils ld? Or also, say, w32,
> or AIX non-runtimelinking, or otherwise native non-GNU linker?
> Can we assume the libGL and libX11 all come from X.org?
> Is using a wrapper shell script acceptable for you?
> Is patching a binary (a la objcopy) acceptable for you?>
I found a solution to this problem I'd like to share here
(see attachemed Makefile.am).
However, this way I had to modify the system libGL/libX11
files by stripping away their DT_SONAME. I did not manage
how to do so, but I at least found a way to rename this entry.
With this build system, the user is expected to have the $(libdir) in
LD_LIBRARY_PATH (or /etc/ld.so.conf), which is much better than
enforcing him to use LD_PRELOAD_LIBRARY because now the lib is only
loaded when the client app is linked against libGL and/or libX11.
However, I do not know how portable this is ;)
Christian.
Makefile.am
Description: Text Data
pgpGuKIrF4qHK.pgp
Description: PGP signature