On 20-Jul-00 Raymond Wiker wrote:
> Is it possible, at all, to use dlopen etc from a
> statically-linked executable? My experiments with FreeBSD-4.0 (see
> below) indicate that it's not possible.
You can't do it from a statically linked binary, however you can create a
dynamic executable with no external unresolved references.. I forget how though
:-/
> The reason that I'd like this to work is that SBCL (a Common
> Lisp implementation, see http://sbcl.sourceforge.net) needs the
> addresses of certain library symbols (e.g, errno) when building the
> initial lisp image. This seems to require static linking. On the other
> hand, SBCL is severely handicapped if it cannot subsequently use
> dlopen() to load foreign code into the running lisp system.
Well, I don't see why it would need static linking for that.. When the binary
runs the libraries it uses will get loaded, and then it can use dlsym() to get
the addresses it needs..
(ie what I am saying is I don't understand your explanation :)
> raw : ~ $ gcc -static dltest.c -o dltest
> raw : ~ $ ./dltest
> dlopen returned 0: Service unavailable
> Handle: 0x0, main: 0x0
>
> raw : ~ $ gcc dltest.c -o dltest
> raw : ~ $ ./dltest
> Handle: 0x2805e000, main: 0x0
> Handle: 0x0, main: 0x0
>
> [ Note: this seems wrong; according to the manpage for dlsym, the
> second call should give the same output as the first. ]
Agreed.
---
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message