* Alternative to LD_PRELOAD
@ 2006-06-01 9:18 arvind k
2006-06-01 16:23 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: arvind k @ 2006-06-01 9:18 UTC (permalink / raw)
To: binutils
Hi All,
I am looking for an alternative to LD_PRELOAD
functionality. My application is "setuid root" and
hence I can not use LD_PRELOAD. Is there any other
way by which I can force preloading a shared library
(say liba.so) when I start the application?
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?
I tried the following. But it doesn't work.
gcc -shared -Wl,-soname,libb1.so -o libb1.so.1.0.1
-Wl,--whole-archive libb.so liba.so
-Wl,--no-whole-archive -lc
Thanks in advance,
Arvind.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Alternative to LD_PRELOAD
2006-06-01 9:18 Alternative to LD_PRELOAD arvind k
@ 2006-06-01 16:23 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2006-06-01 16:23 UTC (permalink / raw)
To: arvind k; +Cc: binutils
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-01 15:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-01 9:18 Alternative to LD_PRELOAD arvind k
2006-06-01 16:23 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).