Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Nov 2000 12:30:19 -0500
From:      Brian McGovern <mcgovern@spoon.beta.com>
To:        questions@freebsd.org
Subject:   Altering dynamic loader from within application...
Message-ID:  <200011301730.eAUHUJK31140@spoon.beta.com>

next in thread | raw e-mail | index | archive | help
I have a bit of an odd case that I can't find documentation for, so I ask
those who know better....

I'm writing an application that supports using dlopen() to make it extensible.
However, since the shared objects it loads aren't really 'shared libraries'
that one would typically put under /usr/lib or /usr/local/lib (etc), I was
hoping to keep them in a sub-directory where the rest of the files needed for
the application would live.

Now, the 'easy' way out would be to either a.) specify a full pathname to the
loader to find the libraries, or b.) set LD_LIBRARY_PATH before entering the 
application. However, since the application itself is dynamically linked, I 
don't trust the user to set LD_LIBRARY_PATH correctly before running the 
program (I'm afraid the standard paths won't get set), and I'd like to allow 
the user to not have to specify full paths to all the libraries in the 
configuration file. I've considered writing a wrapper script around the
application, but then it needs to be modified based on where the application
has been installed, and a lot of that information is already available in
the config file.

Therefore, is there a way to change the linker behavior once the application
has started?... Namely, the equivelent of setting LD_LIBRARY_PATH _after_ the
application has loaded all of the initial libraries and started running, but
before I get around to calling my loader?

	-Brian


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200011301730.eAUHUJK31140>