From: imp@boulder.parcplace.com (Warner Losh) Subject: Re: DLL's for linux Date: Mon, 2 Aug 1993 16:20:42 GMT
In article <744262858snx@crynwr.com> nelson@crynwr.com (Russell Nelson) writes:
> f = GetFunc("MyLib","_foo"); /* load library and get function */
> (f*)(); /* call foo */
> Can you do this with a shared library ?
>Not that *I* know of. Shared libraries don't have a directory. On
>the other hand, you *could* crack the .s file and create a pointer
>into the right place. Hmmm... but then I don't know how you'd get
>the library loaded.
If the shared library hasn't been stripped, then you can find the
right address. If it is stripped, then I don't know if you can find
out from what is in the shared library. I rather doubt it, given the
restrictions placed on them. You can look at the source to libc to
find out how to load the library at that address. It is, I believe, a
system call of some sort. And you'll have to know, a priori, the
address the library needs to live at, since it must be loaded at
a fixed location in memory.
Warner
-- Warner Losh imp@boulder.parcplace.COM ParcPlace Boulder I've almost finished my brute force solution to subtlety.