[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libtool cannot handle _init()and _fini()

From: dada
Subject: Re: libtool cannot handle _init()and _fini()
Date: Thu, 23 Sep 2004 17:15:37 +0200
User-agent: Internet Messaging Program (IMP) 4.0-cvs

The best somewhat portable way (known to me) of wrapping libc functions is to
preload a shared library (usually via LD_PRELOAD) containing the wrapper
The wrappers can access the originial functions via dlsym(RTLD_NEXT) or less
elegant by dlopening libc.
Calling initialization functions at module load time as you suggested is not an
option in this scenario, because usually neither the run time linker nor the
(later loaded and initialized) wrapped application know about the preloaded
Building such a library with libtool and C fails, because libtool does not use
-nostdlib. C++ works, again because of -nostdlib.
Are there any reasons why C and C++ libraries are treating the -nostdlib option
in  a non-uniform way?

P.S.: Sorry for the very very late response to your 5 Jul 2004 posting and thank
you about the -Xlinker option hint.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]