This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Alternative to LD_PRELOAD


On Thu, Jun 01, 2006 at 02:18:45AM -0700, arvind k wrote:
> My application is already linked with another shared 
> library (say libb.so). So can I combine libb.so with 
> liba.so using ld or gcc, so that both library code 
> gets loaded when the application is executed?

Create a new shared library which depends on both libb.so and liba.so:

gcc -shared -Wl,-soname,libb1.so -o libb1.so -lb -la

Then arrange for that to be found when the application tries to open
libb.so.  You'll need to mess around with search paths so that libb1.so
pulls in the original libb.so.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]